/* =========================================================
   RedemptionArc — Design System
   Dark cybersecurity aesthetic, RTL, Persian typography
   ========================================================= */

/* Fonts are loaded with <link> in includes/header.php — an @import here would
   block first paint until the font stylesheet finishes downloading. */

:root {
  /* Palette */
  --bg-void:        #070b12;
  --bg-panel:       #0d131e;
  --bg-panel-alt:   #121a29;
  --border-line:    #1c2635;
  --text-primary:   #e4ebf3;
  /* Secondary and muted used to sit at #8593a6 / #566378, which fell below
     4.5:1 against the near-black background — body copy in those tones was
     what made the site read as "unlit". assets/css/theme.css can lift the
     whole palette further from the navbar control. */
  --text-secondary: #9aa8ba;
  --text-muted:     #74849a;
  --accent-green:   #39ff88;
  --accent-blue:    #2dd4ff;
  --accent-danger:  #ff5c6a;
  --accent-warn:    #ffb84d;
  --gradient-signal: linear-gradient(135deg, #39ff88 0%, #2dd4ff 100%);

  /* Type */
  --font-fa: 'Vazirmatn', Tahoma, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --max-width: 1200px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-void);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(57,255,136,0.06) 0%, transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(45,212,255,0.05) 0%, transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-fa);
  direction: rtl;
  line-height: 1.85;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

/* ---------------------------------------------------------
   Terminal-style "signature" motif — used sparingly
   --------------------------------------------------------- */
.term-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-green);
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  direction: ltr;
}
.term-tag::before { content: '//'; opacity: 0.6; }

/* ---------------------------------------------------------
   Navbar
   --------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-line);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.25rem;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--gradient-signal);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #00130a;
  font-size: 0.95rem;
}
.brand-name { color: var(--text-primary); }
.brand-name span { color: var(--accent-green); }

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent-green); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border-line); border-radius: 6px;
  color: var(--text-primary); padding: 0.4rem 0.6rem; cursor: pointer;
}

@media (max-width: 860px) {
  .nav-links {
    position: absolute; top: 100%; right: 0; left: 0;
    background: var(--bg-panel);
    flex-direction: column; align-items: flex-start;
    padding: 1rem 1.25rem; gap: 1rem;
    border-bottom: 1px solid var(--border-line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-block; }
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--gradient-signal);
  color: #00130a;
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(57,255,136,0.35); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border-color: var(--border-line);
  color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--accent-green); color: var(--accent-green); }
.btn-danger { background: rgba(255,92,106,0.12); color: var(--accent-danger); border-color: rgba(255,92,106,0.3); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
.hero {
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--border-line);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-eyebrow { margin-bottom: 1rem; }
.hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.4;
  margin: 0 0 1rem;
}
.hero h1 .highlight {
  background: var(--gradient-signal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead { color: var(--text-secondary); font-size: 1.05rem; max-width: 46ch; margin-bottom: 1.75rem; }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.hero-stats {
  display: flex; gap: 1.5rem; margin-top: 2.25rem; flex-wrap: wrap;
}
.stat-block .num {
  font-family: var(--font-mono);
  font-size: 1.7rem; font-weight: 700; color: var(--accent-green);
}
.stat-block .label { color: var(--text-muted); font-size: 0.82rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.stat-block .label .ico-sm { opacity: 0.7; }

/* Featured article panel (hero right side) */
.featured-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
  overflow: hidden;
}
.featured-card .thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(160deg, #0f1c16, #0a1420);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.featured-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.featured-card .body { padding: 1.25rem; }
.featured-card .cat-pill {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent-blue);
  border: 1px solid rgba(45,212,255,0.35);
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  margin-bottom: 0.6rem;
}
.featured-card h3 { margin: 0 0 0.5rem; font-size: 1.15rem; line-height: 1.6; }
.featured-card .meta { color: var(--text-muted); font-size: 0.8rem; }

/* ---------------------------------------------------------
   Section headers
   --------------------------------------------------------- */
.section { padding: 3rem 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1.75rem; flex-wrap: wrap; gap: 0.75rem;
}
.section-head h2 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.section-head .see-all { color: var(--accent-green); font-size: 0.9rem; font-weight: 500; display: inline-flex; align-items: center; gap: 0.3rem; }
.section-head .see-all .ico-sm { transition: transform 0.2s; }
.section-head .see-all:hover .ico-sm { transform: translateX(-3px); }

/* ---------------------------------------------------------
   Article grid & cards
   --------------------------------------------------------- */
.grid-articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 980px) { .grid-articles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-articles { grid-template-columns: 1fr; } }

.article-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}
.article-card:hover { border-color: rgba(57,255,136,0.4); transform: translateY(-2px); }
.article-card .thumb { aspect-ratio: 16/10; background: var(--bg-panel-alt); overflow: hidden; }
.article-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card .body { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.article-card .cat-pill {
  align-self: flex-start;
  font-size: 0.72rem; color: var(--accent-green);
  border: 1px solid rgba(57,255,136,0.3);
  padding: 0.15rem 0.6rem; border-radius: 20px;
}
.article-card h3 { font-size: 1.05rem; margin: 0; line-height: 1.6; }
.article-card p { color: var(--text-secondary); font-size: 0.88rem; margin: 0; flex: 1; }
.article-card .meta {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-muted); font-size: 0.76rem;
  border-top: 1px solid var(--border-line); padding-top: 0.7rem;
}
.article-card .meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.article-card .meta .ico-sm { width: 14px; height: 14px; opacity: 0.65; }
.featured-card .meta { display: flex; gap: 1rem; align-items: center; }
.featured-card .meta span { display: inline-flex; align-items: center; gap: 0.3rem; }

/* ---------------------------------------------------------
   Telegram CTA banner
   --------------------------------------------------------- */
.telegram-banner {
  background: linear-gradient(120deg, rgba(45,212,255,0.08), rgba(57,255,136,0.06));
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  flex-wrap: wrap;
}
.telegram-banner .icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: #229ed9; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.telegram-banner .icon svg { width: 24px; height: 24px; fill: #fff; }
.telegram-banner .text h3 { margin: 0 0 0.2rem; font-size: 1.1rem; }
.telegram-banner .text p { margin: 0; color: var(--text-secondary); font-size: 0.9rem; }

/* Sidebar telegram widget */
.widget {
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.widget h4 { margin: 0 0 1rem; font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; }
.widget .cat-list a {
  display: flex; justify-content: space-between;
  padding: 0.5rem 0; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-line); font-size: 0.9rem;
}
.widget .cat-list a:last-child { border-bottom: none; }
.widget .cat-list a:hover { color: var(--accent-green); }
.widget .cat-list .count { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.78rem; }

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */
.form-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 480px;
  margin: 0 auto;
}
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.88rem; color: var(--text-secondary); }
.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-void);
  border: 1px solid var(--border-line);
  border-radius: 7px;
  color: var(--text-primary);
  font-family: var(--font-fa);
  font-size: 0.95rem;
}
.form-control:focus { border-color: var(--accent-green); outline: none; }
textarea.form-control { resize: vertical; min-height: 120px; }

.alert {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
}
.alert-success { background: rgba(57,255,136,0.1); color: var(--accent-green); border: 1px solid rgba(57,255,136,0.3); }
.alert-error { background: rgba(255,92,106,0.1); color: var(--accent-danger); border: 1px solid rgba(255,92,106,0.3); }

/* ---------------------------------------------------------
   Account gate — shown where a form would be when the visitor
   is not signed in or has not verified their address yet.
   --------------------------------------------------------- */
.gate-box {
  text-align: center;
  padding: 2rem 1.25rem;
  border: 1px dashed var(--border-line);
  border-radius: var(--radius);
  background: var(--bg-void);
}
.gate-box .gate-ic {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.9rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(57,255,136,0.08);
  border: 1px solid rgba(57,255,136,0.25);
  color: var(--accent-green);
}
.gate-box .gate-ic .ico { width: 24px; height: 24px; }
.gate-box p { color: var(--text-secondary); font-size: 0.92rem; margin: 0 0 1.1rem; line-height: 2; }
.gate-box .btn { margin: 0 0.25rem; }
.gate-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 1.2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-line);
}
.gate-note b { color: var(--text-secondary); }

/* Verification result mark on /verify */.verify-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid;
}
.verify-mark .ico { width: 30px; height: 30px; }
.verify-idle, .verify-resent { color: var(--accent-blue); border-color: rgba(45,212,255,0.3); background: rgba(45,212,255,0.08); }
.verify-done   { color: var(--accent-green); border-color: rgba(57,255,136,0.3); background: rgba(57,255,136,0.08); }
.verify-failed { color: var(--accent-danger); border-color: rgba(255,92,106,0.3); background: rgba(255,92,106,0.08); }

/* Site-wide nudge under the header while an account is unverified */.verify-banner {
  background: rgba(45,212,255,0.08);
  border-bottom: 1px solid rgba(45,212,255,0.25);
  font-size: 0.86rem;
}
.verify-banner .container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-block: 0.6rem;
  flex-wrap: wrap;
}
.verify-banner .ico { width: 18px; height: 18px; color: var(--accent-blue); flex-shrink: 0; }
.verify-banner span { color: var(--text-secondary); }
.verify-banner a {
  color: var(--accent-blue);
  border-bottom: 1px solid currentColor;
  margin-inline-start: auto;
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Like bar (article footer)
   --------------------------------------------------------- */
.like-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.2rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
}
.like-form { margin: 0; }
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-fa);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-void);
  border: 1px solid var(--border-line);
  border-radius: 40px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.12s;
}
.like-btn:hover { color: var(--accent-danger); border-color: rgba(255,92,106,0.4); }
.like-btn:active { transform: scale(0.96); }
.like-btn .ico { width: 20px; height: 20px; transition: fill 0.18s, transform 0.18s; }
.like-btn .like-count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding-inline-start: 0.55rem;
  margin-inline-start: 0.1rem;
  border-inline-start: 1px solid var(--border-line);
  opacity: 0.85;
}
.like-btn.is-liked {
  color: var(--accent-danger);
  border-color: rgba(255,92,106,0.45);
  background: rgba(255,92,106,0.09);
}
/* The heart is stroke-only by default; filling it is the whole state change. */
.like-btn.is-liked .ico { fill: currentColor; }
.like-btn[disabled] { opacity: 0.55; cursor: progress; }
.like-btn.is-blocked { cursor: not-allowed; }
.like-note { margin: 0; color: var(--text-muted); font-size: 0.85rem; line-height: 1.9; }

/* One pop when it is switched on, skipped for reduced-motion users. */
@keyframes like-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.like-btn.just-liked .ico { animation: like-pop 0.34s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .like-btn.just-liked .ico { animation: none; }
}

/* ---------------------------------------------------------
   Single article page
   --------------------------------------------------------- */
.article-header { padding: 3rem 0 1.5rem; border-bottom: 1px solid var(--border-line); }
.article-header .cat-pill { color: var(--accent-blue); border-color: rgba(45,212,255,0.35); margin-bottom: 1rem; display: inline-block; font-size: 0.78rem; padding: 0.2rem 0.7rem; border-radius: 20px; border: 1px solid; }
.article-header h1 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.6; margin: 0 0 1rem; }
.article-header .meta { display: flex; gap: 1.25rem; color: var(--text-muted); font-size: 0.85rem; flex-wrap: wrap; align-items: center; }
.article-header .meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.article-header .meta .ico-sm { color: var(--accent-green); opacity: 0.75; }

.article-body { max-width: 760px; margin: 2.5rem auto; font-size: 1.05rem; }
.article-body img { border-radius: var(--radius); margin: 1.5rem 0; }
.article-body h2, .article-body h3 { margin-top: 2rem; }
.article-body p { margin-bottom: 1.3rem; color: var(--text-primary); }
.article-body a { color: var(--accent-green); text-decoration: underline; }

.article-layout { display: grid; grid-template-columns: 2.2fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------
   Comments
   --------------------------------------------------------- */
.comments-section { max-width: 760px; margin: 0 auto 3rem; }
.comment-item {
  display: flex; gap: 0.9rem; padding: 1.2rem 0;
  border-bottom: 1px solid var(--border-line);
}
.comment-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gradient-signal); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #00130a; font-family: var(--font-mono);
}
.comment-body { flex: 1; }
.comment-body .name { font-weight: 600; font-size: 0.92rem; }
.comment-body .time { color: var(--text-muted); font-size: 0.76rem; font-family: var(--font-mono); direction: ltr; display: inline-block; }
.comment-body p { margin: 0.4rem 0 0; color: var(--text-secondary); font-size: 0.92rem; }

/* ---------------------------------------------------------
   Pagination
   --------------------------------------------------------- */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2.5rem; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 7px;
  border: 1px solid var(--border-line); font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--text-secondary);
}
.pagination a:hover { border-color: var(--accent-green); color: var(--accent-green); }
.pagination .active { background: var(--gradient-signal); color: #00130a; border-color: transparent; }

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.footer { border-top: 1px solid var(--border-line); padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h5 { font-size: 0.9rem; margin: 0 0 1rem; color: var(--text-primary); }
.footer ul li { margin-bottom: 0.6rem; }
.footer ul li a { color: var(--text-secondary); font-size: 0.88rem; }
.footer ul li a:hover { color: var(--accent-green); }
.footer p.about { color: var(--text-secondary); font-size: 0.88rem; max-width: 40ch; }
.footer-social { display: flex; gap: 0.7rem; margin-top: 1rem; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border-line);
  display: flex; align-items: center; justify-content: center;
}
.footer-social a:hover { border-color: var(--accent-green); }
.footer-social svg { width: 17px; height: 17px; fill: var(--text-secondary); }
.footer-bottom {
  border-top: 1px solid var(--border-line); padding-top: 1.25rem;
  display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.8rem; flex-wrap: wrap; gap: 0.5rem;
}
.footer-bottom .term-tag { direction: ltr; }

/* ---------------------------------------------------------
   Generic page (about/contact) panel
   --------------------------------------------------------- */
.page-header { padding: 3rem 0 1rem; text-align: center; }
.page-header h1 { font-size: 2rem; margin-bottom: 0.6rem; }
.page-header p { color: var(--text-secondary); max-width: 55ch; margin: 0 auto; }

.content-panel {
  background: var(--bg-panel); border: 1px solid var(--border-line);
  border-radius: var(--radius); padding: 2rem; max-width: 800px; margin: 2rem auto;
}
.content-panel h2 { color: var(--accent-green); font-size: 1.2rem; margin-top: 1.75rem; }
.content-panel p { color: var(--text-secondary); }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; max-width: 900px; margin: 2rem auto; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info-item { display: flex; gap: 0.9rem; margin-bottom: 1.3rem; }
.contact-info-item .ic {
  width: 40px; height: 40px; border-radius: 8px; background: var(--bg-panel-alt);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--accent-green);
}

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state .term-tag { display: block; margin-bottom: 0.6rem; justify-content: center; }

/* =========================================================
   Icons
   ========================================================= */
.ico { width: 20px; height: 20px; flex-shrink: 0; vertical-align: -0.25em; }
.ico-sm { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -0.2em; }
.ico-lg { width: 26px; height: 26px; flex-shrink: 0; }
.ico-accent { color: var(--accent-green); }

.nav-links a { display: inline-flex; align-items: center; gap: 0.45rem; }
.nav-links a .ico { width: 17px; height: 17px; opacity: 0.65; transition: opacity 0.15s, transform 0.2s; }
.nav-links a:hover .ico, .nav-links a.active .ico { opacity: 1; transform: translateY(-1px); }
.nav-toggle { display: none; line-height: 0; }
@media (max-width: 860px) { .nav-toggle { display: inline-flex; } }

.widget h4 .ico { width: 18px; height: 18px; }
.btn .ico { width: 17px; height: 17px; }

/* Search bar (articles page) */
.search-bar {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: 10px;
  padding: 0.4rem 0.9rem;
  margin-bottom: 2rem;
  transition: border-color 0.15s, box-shadow 0.2s;
}
.search-bar:focus-within { border-color: rgba(57,255,136,0.55); box-shadow: 0 0 0 3px rgba(57,255,136,0.08); }
.search-bar .ico { color: var(--text-muted); }
.search-bar .form-control {
  flex: 1; background: transparent; border: none; padding: 0.45rem 0;
}
.search-bar .form-control:focus { outline: none; border: none; }
.search-bar .form-control::-webkit-search-cancel-button { filter: invert(0.6); }
.section-head h2 { display: flex; align-items: center; gap: 0.55rem; }
.section-head h2 .ico { color: var(--accent-green); width: 22px; height: 22px; }

/* =========================================================
   Motion — every rule below is disabled by the
   prefers-reduced-motion block further down.
   ========================================================= */

/* Scroll reveal (class added by assets/js/content.js) */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Stagger cards inside a grid so a row does not pop in all at once */
.grid-articles .reveal:nth-child(2).is-in { transition-delay: 0.07s; }
.grid-articles .reveal:nth-child(3).is-in { transition-delay: 0.14s; }
.grid-articles .reveal:nth-child(4).is-in { transition-delay: 0.05s; }
.grid-articles .reveal:nth-child(5).is-in { transition-delay: 0.11s; }
.grid-articles .reveal:nth-child(6).is-in { transition-delay: 0.17s; }

/* Page entrance for the hero copy */
@keyframes ra-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.hero-eyebrow, .hero h1, .hero p.lead, .hero-actions, .hero-stats {
  animation: ra-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero h1        { animation-delay: 0.05s; }
.hero p.lead    { animation-delay: 0.12s; }
.hero-actions   { animation-delay: 0.18s; }
.hero-stats     { animation-delay: 0.24s; }
.featured-card  { animation: ra-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both; }

/* Slow drifting glow behind the hero */
@keyframes ra-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-3%, 3%, 0) scale(1.08); }
}
.hero::before {
  content: '';
  position: absolute;
  inset: -35% -10% auto -10%;
  height: 130%;
  background:
    radial-gradient(circle at 25% 40%, rgba(57,255,136,0.10), transparent 55%),
    radial-gradient(circle at 78% 30%, rgba(45,212,255,0.09), transparent 55%);
  animation: ra-drift 18s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

/* Cards: lift the thumbnail, not just the box */
.article-card .thumb img { transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.article-card:hover .thumb img { transform: scale(1.05); }
.article-card:hover { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35); }
.article-card h3 { transition: color 0.15s; }
.article-card:hover h3 { color: var(--accent-green); }

/* Underline sweep on nav links */
.nav-links a::after {
  content: '';
  position: absolute;
  right: 0; bottom: -6px; left: 0;
  height: 2px; border-radius: 2px;
  background: var(--gradient-signal);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
@media (max-width: 860px) { .nav-links a::after { display: none; } }

/* Blinking cursor on the terminal motif */
@keyframes ra-blink { 0%, 45% { opacity: 1; } 55%, 100% { opacity: 0; } }
.term-tag::after {
  content: '_';
  animation: ra-blink 1.15s steps(1) infinite;
  opacity: 0.8;
}

/* Telegram banner icon pulse */
@keyframes ra-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 158, 217, 0.45); }
  70%      { box-shadow: 0 0 0 14px rgba(34, 158, 217, 0); }
}
.telegram-banner .icon { animation: ra-pulse 2.8s ease-out infinite; }

/* Pagination + footer polish */
.pagination a { transition: border-color 0.15s, color 0.15s, transform 0.15s; }
.pagination a:hover { transform: translateY(-2px); }
.footer-social a { transition: border-color 0.15s, transform 0.15s; }
.footer-social a:hover { transform: translateY(-2px); }
.footer ul li a { transition: color 0.15s, padding 0.15s; }
.footer ul li a:hover { padding-right: 0.3rem; }

/* Anything animated stays visible when motion is reduced */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero::before { display: none; }
  .term-tag::after { content: ''; }
  .article-card:hover .thumb img,
  .pagination a:hover,
  .footer-social a:hover { transform: none; }
}
