:root {
  --bg: #06111f;
  --panel: rgba(11, 27, 48, 0.78);
  --panel-strong: rgba(15, 37, 64, 0.94);
  --text: #eef7ff;
  --muted: #9db2c7;
  --line: rgba(255, 255, 255, 0.11);
  --accent: #7af5d5;
  --accent-2: #86a8ff;
  --warm: #f7c66f;
  --danger: #ff7c91;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Noto Sans Armenian', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(122, 245, 213, 0.13), transparent 28rem),
    radial-gradient(circle at 80% 3%, rgba(134, 168, 255, 0.18), transparent 32rem),
    linear-gradient(145deg, #06111f 0%, #091526 52%, #0c1726 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 82%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(6, 17, 31, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #05101e;
  box-shadow: 0 12px 30px rgba(122,245,213,0.22);
}
.brand strong { display: block; letter-spacing: 0.06em; }
.brand small { display: block; color: var(--muted); margin-top: 2px; }

.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  transition: 0.2s ease;
}
.nav a:hover { color: var(--text); border-color: var(--line); background: rgba(255,255,255,0.05); }

main { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: center;
  padding: 56px 0 28px;
}
.hero-copy h1 {
  margin: 12px 0 18px;
  max-width: 820px;
  font-size: clamp(38px, 6vw, 74px);
  line-height: 1.06;
  letter-spacing: -0.04em;
}
.hero-copy p, .section-head p, .method-card p, .formula-note, .steps p {
  color: var(--muted);
  line-height: 1.8;
}
.hero-copy p { max-width: 780px; font-size: 17px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 12px;
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  border-radius: 20px;
  background: currentColor;
}
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 700;
  border: 1px solid var(--line);
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071424;
  border: none;
}
.btn.ghost { background: rgba(255,255,255,0.05); color: var(--text); }

.hero-card {
  position: relative;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(160deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  top: -120px;
  right: -100px;
  background: radial-gradient(circle, rgba(122,245,213,0.33), transparent 68%);
}
.formula-chip {
  position: relative;
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(122,245,213,0.12);
  color: var(--accent);
  border: 1px solid rgba(122,245,213,0.25);
  font-weight: 700;
}
.formula-title { margin: 26px 0 12px; color: var(--muted); }
.formula {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(4, 12, 23, 0.52);
  font-size: clamp(19px, 3vw, 30px);
  font-weight: 800;
  line-height: 1.55;
}
.formula span { color: var(--accent); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,0.055);
}
.stat-card span { display: block; font-size: clamp(24px, 4vw, 38px); font-weight: 800; }
.stat-card p { margin: 6px 0 0; color: var(--muted); }

.panel, .methodology {
  margin: 22px 0;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.section-head h2, .method-card h2 {
  margin: 8px 0 10px;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.2;
}
.section-head p { margin: 0; max-width: 780px; }
.section-head.compact { margin-bottom: 18px; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; min-width: 220px; }
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.high { background: var(--accent); }
.dot.mid { background: var(--warm); }
.dot.low { background: var(--danger); }
.chart-shell {
  position: relative;
  min-height: 410px;
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 20%, rgba(122,245,213,0.10), transparent 20rem),
    rgba(4, 12, 23, 0.52);
}
canvas { display: block; width: 100%; height: auto; max-height: 620px; cursor: crosshair; }
.tooltip {
  display: none;
  position: absolute;
  pointer-events: none;
  z-index: 5;
  transform: translate(12px, 12px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4,12,23,0.94);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  min-width: 170px;
}
.tooltip strong { display: block; margin-bottom: 4px; }

.controls {
  display: grid;
  grid-template-columns: 1fr minmax(170px, 240px) minmax(160px, 220px);
  gap: 12px;
  margin: 22px 0;
}
.search-box, .select-box {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
input, select {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  color: var(--text);
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
}
select option { color: #06111f; }
input:focus, select:focus { border-color: rgba(122,245,213,0.55); box-shadow: 0 0 0 4px rgba(122,245,213,0.10); }
.community-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.community-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  min-height: 196px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035));
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.community-card:hover { transform: translateY(-3px); border-color: rgba(122,245,213,0.35); background: rgba(255,255,255,0.08); }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-title h3 { margin: 0 0 5px; font-size: 18px; }
.card-title p { margin: 0; color: var(--muted); font-size: 13px; }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(122,245,213,0.11);
  color: var(--accent);
  font-weight: 800;
  border: 1px solid rgba(122,245,213,0.22);
}
.score-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.score { font-size: 38px; line-height: 1; font-weight: 800; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
}
.status-pill.high { color: var(--accent); }
.status-pill.mid { color: var(--warm); }
.status-pill.low { color: var(--danger); }
.mini-bars { display: grid; gap: 8px; }
.mini-bar { display: grid; grid-template-columns: 32px 1fr 42px; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.track { height: 7px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; }
.fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.fill.admin { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.fill.citizen { background: linear-gradient(90deg, var(--accent-2), var(--warm)); }
.fill.economy { background: linear-gradient(90deg, var(--warm), var(--accent)); }
.fill.gap { background: linear-gradient(90deg, var(--danger), var(--warm)); }

.methodology {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.method-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.method-card h3 { margin: 0 0 12px; }
.method-card p { margin: 0; }
.method-card.big p { max-width: 680px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.steps article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,0.05);
}
.steps span { color: var(--accent); font-weight: 800; letter-spacing: 0.12em; }
.steps h3 { margin: 12px 0 8px; }
.steps p { margin: 0; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(520px, 100%);
  height: 100vh;
  transform: translateX(104%);
  transition: transform 0.24s ease;
  padding: 30px;
  overflow-y: auto;
  background: rgba(7, 18, 32, 0.98);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 80px rgba(0,0,0,0.42);
}
.drawer.open { transform: translateX(0); }
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0,0,0,0.55);
}
.overlay.open { display: block; }
.close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 28px;
}
.drawer h2 { margin: 18px 0 4px; font-size: 34px; }
.drawer-sub { color: var(--muted); margin: 0 0 18px; }
.drawer-score {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,0.055);
}
.big-score { font-size: 54px; font-weight: 800; line-height: 1; }
.drawer-section { margin-top: 20px; }
.drawer-section h3 { margin: 0 0 12px; }
.indicator-list { display: grid; gap: 10px; }
.indicator-row { display: grid; grid-template-columns: 1fr 52px; gap: 10px; align-items: center; }
.indicator-row label { color: var(--muted); font-size: 13px; }
.rec-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(122,245,213,0.22);
  background: rgba(122,245,213,0.08);
  color: #dffdf5;
  line-height: 1.7;
}
.site-link { display: inline-flex; margin-top: 14px; color: var(--accent); font-weight: 700; }
.footer {
  width: min(1200px, calc(100% - 32px));
  margin: 36px auto 0;
  padding: 28px 0 40px;
  color: var(--muted);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}
.footer p { margin: 0; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .stats, .community-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .methodology, .steps, .controls { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; }
  .legend { justify-content: flex-start; }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; }
  .stats, .community-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 34px; }
  .hero-card, .panel, .method-card { border-radius: 24px; }
  .drawer { padding: 20px; }
  .drawer-score { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
}
