@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Soft gray palette (Blueprint light grays + blue).
   Dark gray text on light gray, no pure black/white: easier on astigmatic eyes. */
:root {
  --bg: #e5e8eb;
  --grid: #d3d8de;
  --surface: #f6f7f9;
  --surface-2: #edeff2;
  --text: #252a31;
  --muted: #404854;
  --faint: #5f6b7c;
  --accent: #215db0;
  --accent-deep: #2d72d2;
  --line: #c5cbd3;
  --radius: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}
/* Same drifting grid as the old "coming soon" page */
body::before {
  content: "";
  position: fixed;
  inset: -30%;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 48px 48px,
    radial-gradient(circle at 50% 35%, rgba(45,114,210,.10), transparent 45%);
  animation: drift 18s ease-in-out infinite alternate;
  z-index: -1;
  pointer-events: none;
}
@keyframes drift { to { transform: translate(4%, -4%) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: ui-monospace, Consolas, monospace;
  direction: ltr; unicode-bidi: isolate;
  background: var(--surface-2); padding: 1px 6px; border-radius: 3px; font-size: .88em;
}
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 18px; }
.brand:hover { text-decoration: none; }
.mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font-size: 16px;
}
.top-note { color: var(--muted); font-size: 13px; }

#app { flex: 1; padding-top: 32px; padding-bottom: 48px; }

/* Hero */
.hero h1 { font-size: clamp(24px, 5vw, 34px); font-weight: 800; line-height: 1.5; }
.hero p { color: var(--muted); margin-top: 8px; max-width: 640px; }

/* Controls */
.controls { margin-top: 24px; display: grid; gap: 14px; }
.search {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; font-size: 16px;
}
.search:focus { outline: 2px solid var(--accent-deep); outline-offset: 0; border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 13px; color: var(--muted); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 12px;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip { background: var(--surface); }
.chip[aria-pressed="true"] { color: #fff; background: var(--accent-deep); border-color: var(--accent-deep); }
.count { color: var(--faint); font-size: 13px; }

/* Grid */
.grid { margin-top: 18px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; color: var(--text); min-height: 170px;
}
.card:hover { border-color: var(--accent-deep); text-decoration: none; }
.card h3 { font-size: 16px; font-weight: 700; line-height: 1.6; }
.card p { color: var(--muted); font-size: 14px; line-height: 1.8; flex: 1; }
.card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); }
.en { direction: ltr; unicode-bidi: isolate; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-size: 11px; padding: 1px 8px; border-radius: 2px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.badge.skill { color: #184a90; border-color: #2d72d2; background: #e6effc; }
.badge.connector { color: #165a36; border-color: #238551; background: #e5f4ec; }
.badge.request { color: #77450d; border-color: #c87619; background: #fcf0e2; }
.badge.official { color: var(--text); background: var(--surface-2); }

.empty { margin-top: 24px; padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* Detail */
.back { display: inline-block; margin-bottom: 20px; font-size: 14px; }
.detail { max-width: 760px; }
.detail h1 { font-size: clamp(22px, 5vw, 30px); font-weight: 800; line-height: 1.5; margin: 10px 0 4px; }
.detail .lead { font-size: 17px; color: var(--text); margin-top: 14px; }
.section { margin-top: 26px; }
.section h2 { font-size: 15px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.section ul { padding-right: 20px; }
.section li { margin: 4px 0; }
.facts {
  margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px;
}
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.fact small { display: block; color: var(--faint); font-size: 12px; }
.fact span { font-size: 14px; }
details.tech {
  margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
}
details.tech summary { cursor: pointer; font-weight: 700; }
details.tech p { margin-top: 10px; color: var(--muted); font-size: 15px; }
.cta {
  display: inline-block; margin-top: 26px; background: var(--accent-deep); color: #fff;
  padding: 10px 18px; border-radius: var(--radius); font-weight: 700;
}
.cta:hover { background: var(--accent); text-decoration: none; }
.note { margin-top: 18px; font-size: 13px; color: var(--faint); }

/* Coming soon box */
.soon {
  margin-top: 40px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(45,114,210,.12), transparent 60%);
}
.soon h2 { font-size: 17px; }
.soon p { color: var(--muted); font-size: 14px; margin-top: 6px; }

.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 20px 0; font-size: 13px; color: var(--muted); }
.soon { background: var(--surface); }
.empty { background: var(--surface); }
.foot p + p { margin-top: 4px; }
