:root {
  --accent-soft: #eef1ff;
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #1a1d29;
  --muted: #5b6072;
  --accent: #3d5cff;
  --accent-dark: #2a3fcc;
  --border: #e4e6f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo-mark {
  color: var(--accent);
  flex-shrink: 0;
  border-radius: 7px;
  transition: transform 0.15s ease;
}

.logo:hover .logo-mark { transform: rotate(-4deg) scale(1.04); }

.logo-text span { color: var(--accent); }

nav.tool-nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 18px;
  font-size: 0.95rem;
  font-weight: 500;
}

nav.tool-nav a:hover, nav.tool-nav a.active { color: var(--accent); }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.1rem;
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(30, 40, 90, 0.08);
}

.tool-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 11px;
  background: var(--accent-soft, #eef1ff);
  color: var(--accent);
}

.tool-card .icon svg { width: 22px; height: 22px; }

.tool-card:hover .icon { background: var(--accent); color: #fff; }
.tool-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.generator-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 800px) {
  .generator-layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fbfbfe;
  color: var(--text);
}

textarea { min-height: 90px; resize: vertical; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 9px;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--accent-dark); }

.btn:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

/* outline button ko hover pe bhara hua kar do, warna blue text blue background pe chala jata hai */
.btn-outline:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-outline:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.qr-output {
  text-align: center;
}

#qrcode {
  display: inline-block;
  padding: 18px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  min-height: 256px;
  min-width: 256px;
}

#qrcode canvas, #qrcode img { display: block; }

.qr-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.radio-row { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.radio-row input { width: auto; }

article.content-block {
  margin-top: 56px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}

article.content-block h2 { margin-top: 0; }
article.content-block h2:not(:first-child) { margin-top: 28px; }

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

.ad-slot {
  margin: 32px 0;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--muted); }

/* ---------- article meta / author ---------- */

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.article-meta .sep { color: var(--border); }

.article-meta a { color: var(--accent); text-decoration: none; }
.article-meta a:hover { text-decoration: underline; }

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-top: 40px;
}

.author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.author-box h4 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.author-box p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- figures / images ---------- */

figure {
  margin: 28px 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  width: auto;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  cursor: zoom-in;
  transition: border-color 0.15s ease;
}

figure a.zoom { display: inline-block; max-width: 100%; }
figure a.zoom:hover img { border-color: var(--accent); }
figure a.zoom:focus-visible img { outline: 2px solid var(--accent); outline-offset: 3px; }

/* chhote example codes ko utna bara na karo */
figure img[src*="example-"] { max-width: 300px; }

figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* ---------- key takeaway box ---------- */

.takeaway {
  background: #f0f3ff;
  border-left: 3px solid var(--accent);
  padding: 18px 22px;
  border-radius: 0 10px 10px 0;
  margin: 28px 0;
}

.takeaway p { margin: 0; font-size: 0.95rem; }
.takeaway strong { color: var(--text); }

/* ---------- comparison table ---------- */

.table-wrap { overflow-x: auto; margin: 24px 0; }

table.cmp {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 460px;
}

table.cmp th, table.cmp td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

table.cmp th {
  background: #f4f6ff;
  font-weight: 600;
  font-size: 0.85rem;
}

table.cmp tr:last-child td { border-bottom: none; }

/* ---------- blog listing ---------- */

.post-list { display: grid; gap: 18px; margin-top: 30px; }

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 40, 90, 0.07);
}

.post-card h3 { margin: 0 0 6px; font-size: 1.12rem; line-height: 1.35; }
.post-card .date { font-size: 0.8rem; color: var(--muted); display: block; margin-bottom: 8px; }
.post-card p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* ---------- prose for long articles ---------- */

.prose { max-width: 72ch; margin: 0 auto; }
.prose h2 { margin-top: 34px; font-size: 1.42rem; }
.prose h3 { margin-top: 26px; font-size: 1.12rem; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose a { color: var(--accent); }

/* ---------- table of contents ---------- */

.toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 20px 24px;
  margin: 0 0 32px;
}

.toc h2 {
  margin: 0 0 12px !important;
  font-size: 0.82rem !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 6px; font-size: 0.94rem; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.prose h2[id] { scroll-margin-top: 20px; }

/* ---------- related posts ---------- */

.related {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 2px solid var(--border);
}

.related > h2 {
  font-size: 1.25rem;
  margin: 0 0 18px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.related-grid a {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  transition: border-color 0.15s ease;
}

.related-grid a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  main { padding: 28px 14px 48px; }

  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 0.98rem; }

  .panel { padding: 18px 16px; }
  article.content-block { padding: 22px 16px; }

  #qrcode {
    min-width: 0;
    max-width: 100%;
    padding: 12px;
  }
  #qrcode canvas, #qrcode img { max-width: 100%; height: auto; }

  .nav-wrap { padding: 12px 14px; gap: 8px; }
  .logo { font-size: 1.1rem; gap: 7px; }
  .logo-mark { width: 26px; height: 26px; }
  nav.tool-nav { display: flex; flex-wrap: wrap; gap: 10px 14px; }
  nav.tool-nav a { margin-left: 0; font-size: 0.88rem; }

  .toc { padding: 16px 18px; }
  .author-box { padding: 16px; gap: 12px; }
  .prose h2 { font-size: 1.25rem; }
  .prose h3 { font-size: 1.05rem; }

  .breadcrumb { font-size: 0.8rem; word-break: break-word; }
  .article-meta { font-size: 0.8rem; gap: 6px; }
}

/* har halat mein page ko side mein scroll na karne do */
html, body { max-width: 100%; }
img, canvas, svg { max-width: 100%; height: auto; }


/* ---------- lightbox ---------- */

.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 16, 23, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
  cursor: zoom-out;
}

.lb-overlay img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  background: #fff;
  border-radius: 10px;
  padding: 12px;
}

.lb-cap {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  text-align: center;
  color: #E8EAF2;
  font-size: 0.88rem;
  line-height: 1.5;
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.lb-close:hover { background: rgba(255,255,255,0.26); }
.lb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

body.lb-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  figure img { transition: none; }
}

/* ---------- keyboard focus ---------- */

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.tool-card:focus-visible,
.post-card:focus-visible,
.related-grid a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-color: var(--accent);
}

.logo:hover .logo-text span { color: var(--accent-dark); }

.logo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}


@media (prefers-reduced-motion: reduce) {
  .logo-mark { transition: none; }
  .logo:hover .logo-mark { transform: none; }
}
