:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #162032;
  --border: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --accent: #6366f1;
  --success: #10b981;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }
html { scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }

body {
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  direction: rtl;
  max-width: 100%;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }

@keyframes inn-pop {
  0% { opacity: 0; transform: scale(0.8) rotate(-8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.logo-mascot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(56, 189, 248, 0.5);
  animation: inn-pop 0.6s ease-out 1 forwards;
}

.nav-links { display: flex; gap: 22px; list-style: none; font-size: 0.94rem; color: var(--muted); font-weight: 600; }
.nav-links a:hover { color: var(--primary); }
.nav-cta {
  background: var(--primary);
  color: #0f172a;
  font-weight: 800;
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 0.86rem;
  white-space: nowrap;
}

/* Hero */
.hero {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.hero-inner { max-width: 740px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.hero h1 { font-size: 2.1rem; line-height: 1.32; margin-bottom: 12px; font-weight: 800; }
.hero h1 span { color: var(--primary); }
.hero p { color: var(--muted); font-size: 1rem; margin-bottom: 20px; }

.search-box {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.94rem;
  outline: none;
  font-family: inherit;
}
.search-box button {
  background: var(--primary);
  color: #0f172a;
  border: none;
  padding: 9px 16px;
  border-radius: 7px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

/* Sections */
.section { padding: 34px 0; }
.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: 1.38rem; font-weight: 800; margin-bottom: 4px; }
.section-head p { color: var(--muted); font-size: 0.92rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* Grafikart-style Path Cards */
.path-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.2s, transform 0.2s;
}
.path-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.path-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; }
.level-pill {
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
  padding: 2px 9px;
  border-radius: 6px;
  font-weight: 700;
}
.path-card h3 { font-size: 1.1rem; font-weight: 800; }
.path-card p { color: var(--muted); font-size: 0.88rem; }
.path-link { color: var(--primary); font-weight: 700; font-size: 0.88rem; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-btn {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.filter-btn.active, .filter-btn:hover {
  background: rgba(56, 189, 248, 0.14);
  color: var(--primary);
  border-color: var(--primary);
}

/* Article Cards */
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.article-card:hover { border-color: var(--primary); }
.cat-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--primary);
  margin-bottom: 8px;
}
.article-card h3 { font-size: 1.06rem; line-height: 1.45; margin-bottom: 6px; }
.article-card p { color: var(--muted); font-size: 0.88rem; }
.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.read-more { color: var(--primary); font-weight: 700; }

/* Prompt Cards */
.prompt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.prompt-text {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.86rem;
  color: var(--text);
}
.copy-prompt-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  font-family: inherit;
}
.copy-prompt-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Lead Box */
.lead-box {
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 22px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.lead-form { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; max-width: 420px; }
.lead-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: inherit;
}
.lead-form button {
  background: var(--primary);
  color: #0f172a;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

/* Article Page (Ironclad Mobile Safe) */
.article-layout { max-width: 820px; margin: 28px auto; width: 100%; }
.article-header { margin-bottom: 22px; }
.article-header h1 { font-size: 1.75rem; line-height: 1.35; margin: 10px 0; }
.article-info { color: var(--muted); font-size: 0.88rem; display: flex; gap: 14px; flex-wrap: wrap; }
.article-body { overflow-wrap: anywhere; word-break: break-word; }
.article-body h2 { font-size: 1.3rem; margin: 24px 0 10px; color: var(--primary); }
.article-body p { margin-bottom: 14px; color: #e2e8f0; }
.article-body ul, .article-body ol { margin: 0 20px 16px 0; color: #e2e8f0; }
.article-body a { color: var(--primary); text-decoration: underline; }

.code-wrap {
  direction: ltr;
  text-align: left;
  background: #090d16;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 16px 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  padding: 7px 12px;
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.copy-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.76rem;
  font-family: "Cairo", sans-serif;
}
.code-wrap pre {
  padding: 12px;
  overflow-x: auto;
  max-width: 100%;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #f8fafc;
}
.prompt-box {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 10px;
  padding: 14px;
  margin: 16px 0;
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.prompt-box pre, .prompt-box code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Footer & Modal */
.footer {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}
.footer-links { display: flex; justify-content: center; gap: 18px; margin-bottom: 10px; flex-wrap: wrap; }
.footer-links button { background: none; border: none; color: var(--muted); cursor: pointer; font-family: inherit; font-size: 0.86rem; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-width: 480px; width: 100%; padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; }

/* PWA Pop-in */
.pwa-popin {
  position: fixed;
  bottom: 14px;
  left: 14px;
  right: 14px;
  max-width: 420px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pwa-popin.show { display: flex; }
.pwa-popin-text strong { display: block; font-size: 0.92rem; }
.pwa-popin-text span { font-size: 0.8rem; color: var(--muted); }
.pwa-popin-actions { display: flex; gap: 6px; flex-shrink: 0; }
.pwa-btn-install { background: var(--primary); color: #0f172a; border: none; padding: 7px 12px; border-radius: 7px; font-weight: 800; cursor: pointer; font-family: inherit; }
.pwa-btn-close { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 7px 9px; border-radius: 7px; cursor: pointer; font-family: inherit; }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 28px 0 22px; }
  .hero h1 { font-size: 1.55rem; }
  .grid-3 { grid-template-columns: 1fr; }
  .lead-form { flex-direction: column; }
  .lead-form button { width: 100%; }
}

.card-cover {
  height: 110px;
  border-radius: 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  border: 1px solid var(--border);
}
.cover-cursor {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(56, 189, 248, 0.15));
  color: #a5b4fc;
}
.cover-docker {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(16, 185, 129, 0.15));
  color: #38bdf8;
}
.cover-pdf {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(245, 158, 11, 0.15));
  color: #34d399;
}

.card-cover-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  display: block;
}

.article-cover-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 16px 0 22px;
  border: 1px solid var(--border);
  display: block;
}

.inn-tip {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius);
  padding: 16px;
  margin: 26px 0 10px;
}
.inn-tip img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.inn-tip strong { color: var(--primary); display: block; margin-bottom: 2px; }
.inn-tip p { margin: 0; font-size: 0.9rem; color: var(--muted); }

.hero-mascot-wrap {
  margin-bottom: 12px;
}
.hero-mascot-main {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
  animation: inn-pop 0.7s ease-out 1 forwards;
}
