/* ============================================
   InPage ↔ Unicode Urdu Converter — product page
   Builds on /style.css design tokens.
   ============================================ */

.ap-page {
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
  --ok: var(--success);
  --warn: hsl(38, 92%, 55%);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.ap-page :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.ap-page code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--glass-glow);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.ap-page p a:not(.btn),
.ap-page li a:not(.btn),
.ap-small a,
.footer-copy a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-glow);
  text-underline-offset: 3px;
}

.ap-page p a:not(.btn):hover,
.ap-page li a:not(.btn):hover { text-decoration-color: var(--accent); }

/* Section rhythm a bit tighter than the homepage */
.ap-page .section { padding: clamp(56px, 8vw, 96px) 0; }
.ap-page .section:nth-of-type(even) { background: linear-gradient(180deg, transparent, var(--bg-secondary) 12%, var(--bg-secondary) 88%, transparent); }
.ap-page .section-subtitle { max-width: 640px; }
.ap-page .section-title code.ap-h-code { font-size: 0.8em; }

/* ---------- Nav additions ---------- */
.ap-page .nav-links { gap: 8px; }
.ap-page .nav .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: var(--accent);
  margin-left: 8px;
  font-weight: 600;
}
.ap-page .nav .nav-cta:hover { background: var(--accent-dim); color: #fff; }
.ap-page .nav .nav-cta .ico { width: 15px; height: 15px; }

/* ---------- Progressive reveal (only when JS is present) ---------- */
.js .js-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.js .js-reveal.in { opacity: 1; transform: none; }

/* ============================================
   HERO
   ============================================ */
.ap-hero {
  position: relative;
  overflow: hidden;
  padding: 128px 0 40px;
}

.ap-hero-glow {
  position: absolute;
  width: 900px;
  height: 900px;
  top: -320px;
  right: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.ap-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
}

.ap-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}
.ap-breadcrumb li + li::before { content: '/'; margin-right: 6px; opacity: 0.6; }
.ap-breadcrumb a { color: var(--text-secondary); }
.ap-breadcrumb a:hover { color: var(--accent); }
.ap-breadcrumb [aria-current] { color: var(--text-primary); }

.ap-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.ap-title {
  font-family: var(--font-heading);
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
}

.ap-title-sub {
  display: block;
  margin-top: 10px;
  font-size: 0.52em;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  background: linear-gradient(90deg, var(--accent), hsl(172, 76%, 48%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ap-lead {
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 580px;
}
.ap-lead strong { color: var(--text-primary); font-weight: 600; }

.ap-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}
.ap-cta .btn { padding: 0.95rem 1.8rem; }
.ap-cta-center { justify-content: center; }

.ap-btn-download {
  font-size: 15px;
  box-shadow: 0 4px 0 hsl(var(--accent-hue), 91%, 40%), 0 12px 40px -8px var(--accent-glow);
}

.ap-release-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-tertiary);
  font-family: var(--mono);
}
.ap-release-meta [data-rel="version"] { color: var(--ok); }

/* ---------- Flow illustration ---------- */
.ap-hero-visual {
  position: relative;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.5);
}

.ap-flow { width: 100%; height: auto; display: block; }
.ap-flow .f-body { fill: var(--bg-elevated); stroke: var(--border-hover); stroke-width: 1.5; }
.ap-flow .f-body.engine-ring { stroke: var(--accent); stroke-opacity: 0.7; }
.ap-flow .f-screen { fill: var(--bg-primary); stroke: var(--border); }
.ap-flow .f-btn { fill: var(--accent); }
.ap-flow .f-btn-text { fill: #fff; font: 600 10.5px var(--font-heading); }
.ap-flow .f-pill-box { fill: var(--glass-glow); stroke: var(--border-hover); }
.ap-flow .f-pill-txt { fill: var(--text-secondary); font: 600 10.5px var(--mono); }
.ap-flow .f-label { fill: var(--text-secondary); font: 500 13px var(--font-body); }
.ap-flow .f-badge-mono { fill: var(--accent); font: 600 10.5px var(--mono); }
.ap-flow .f-mono { fill: var(--ok); font: 500 10.5px var(--mono); }
.ap-flow .f-mono.dim { fill: var(--text-secondary); }
.ap-flow .f-mono.warn-txt { fill: var(--warn); }
.ap-flow .f-chip { fill: var(--glass-glow); stroke: var(--accent); stroke-opacity: 0.5; }
.ap-flow .f-chip-text { fill: var(--accent); font: 600 10.5px var(--mono); }
.ap-flow .f-urdu { fill: var(--text-primary); font: 600 17px var(--urdu); }
.ap-flow .f-urdu-sm { fill: var(--text-secondary); font: 400 13px var(--urdu); }
.ap-flow .f-cable { fill: none; stroke: var(--border-hover); stroke-width: 3; stroke-linecap: round; }
.ap-flow .f-flow { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 10; stroke-linecap: round; animation: dash 1.2s linear infinite; }
.ap-flow .f-flow.rev { stroke: hsl(172, 76%, 48%); animation: dashRev 1.4s linear infinite; }
.ap-flow .f-led { fill: var(--ok); animation: blink 1.6s infinite; }

@keyframes dash { to { stroke-dashoffset: -32; } }
@keyframes dashRev { to { stroke-dashoffset: 32; } }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- Trust bar ---------- */
.ap-trust {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
}
.ap-trust li {
  padding: 22px 18px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.ap-trust li:last-child { border-right: 0; }
.ap-trust strong {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(18px, 2.1vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ap-trust span { font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; }

/* ============================================
   CONTENT BLOCKS
   ============================================ */
.ap-split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}
.ap-split-even { grid-template-columns: 1fr 1fr; }

.ap-prose p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
  max-width: 620px;
}
.ap-prose strong { color: var(--text-primary); }

.ap-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-top: 24px;
}
.ap-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.ap-checks .ico { color: var(--ok); margin-top: 2px; }

.ap-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.55);
}
.ap-figure figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
}

/* ---------- Steps ---------- */
.ap-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
  counter-reset: none;
}
.ap-step {
  position: relative;
  padding: 32px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: border-color 0.3s, transform 0.4s var(--ease-out);
}
.ap-step:hover { border-color: var(--accent); transform: translateY(-4px); }
.ap-step-num {
  position: absolute;
  top: 22px;
  right: 24px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-tertiary);
}
.ap-step-ico { width: 28px; height: 28px; color: var(--accent); margin-bottom: 18px; }
.ap-step h3 { font-family: var(--font-heading); font-size: 20px; margin-bottom: 10px; }
.ap-step p { font-size: 14.5px; color: var(--text-secondary); line-height: 1.7; }

/* ---------- Features ---------- */
.ap-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 48px;
}
.ap-feature {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: border-color 0.3s, background 0.3s, transform 0.4s var(--ease-out);
}
.ap-feature:hover { border-color: var(--border-hover); background: var(--bg-card-hover); transform: translateY(-4px); }
.ap-feature > .ico {
  width: 40px;
  height: 40px;
  padding: 10px;
  border-radius: 12px;
  color: var(--accent);
  background: var(--glass-glow);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.ap-feature h3 { font-family: var(--font-heading); font-size: 17px; margin-bottom: 8px; }
.ap-feature p { font-size: 14px; color: var(--text-secondary); line-height: 1.65; }

/* ---------- Audience cards ---------- */
.ap-devices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 48px;
}
.ap-device {
  padding: 28px 24px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.ap-device > .ico { width: 34px; height: 34px; color: var(--accent); margin: 0 auto 14px; display: block; }
.ap-device h3 { font-family: var(--font-heading); font-size: 18px; margin-bottom: 6px; }
.ap-device p { font-size: 13.5px; color: var(--text-secondary); min-height: 60px; margin-bottom: 14px; line-height: 1.6; }

.ap-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid currentColor;
}
.ap-pill.ok { color: var(--ok); }
.ap-pill.warn { color: var(--warn); }

/* ---------- Install ---------- */
.ap-install {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}

.ap-timeline {
  list-style: none;
  counter-reset: step;
  margin-top: 36px;
  position: relative;
}
.ap-timeline li {
  counter-increment: step;
  position: relative;
  padding: 0 0 30px 64px;
}
.ap-timeline li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -4px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent);
  background: var(--bg-primary);
  z-index: 1;
}
.ap-timeline li::after {
  content: '';
  position: absolute;
  left: 19.5px;
  top: 36px;
  bottom: 0;
  width: 1px;
  background: var(--border-hover);
}
.ap-timeline li:last-child::after { display: none; }
.ap-timeline h3 { font-family: var(--font-heading); font-size: 18px; margin-bottom: 6px; }
.ap-timeline p { color: var(--text-secondary); font-size: 15px; line-height: 1.7; }

.ap-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.ap-req { position: sticky; top: 100px; }
.ap-req h3 { font-family: var(--font-heading); font-size: 18px; margin-bottom: 16px; }
.ap-req ul { display: grid; gap: 12px; margin-bottom: 24px; }
.ap-req li { display: flex; gap: 10px; font-size: 14px; color: var(--text-secondary); }
.ap-req .ico { color: var(--ok); margin-top: 2px; }
.ap-btn-block { width: 100%; padding: 1rem 1.2rem; }
.ap-small { font-size: 13px; color: var(--text-tertiary); margin-top: 14px; text-align: center; }

/* ---------- Narrow content ---------- */
.ap-narrow { max-width: 820px; }

/* ---------- Code ---------- */
.ap-code {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: hsl(220, 22%, 6%);
  overflow: hidden;
}
.ap-code::before {
  content: attr(data-lang);
  display: block;
  padding: 10px 16px;
  font: 500 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(220, 10%, 60%);
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.06);
}
.ap-code pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font: 400 13.5px/1.7 var(--mono);
  color: hsl(220, 15%, 88%);
}
.ap-page .ap-code code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
  word-break: normal;
}
.ap-code .c { color: hsl(220, 10%, 50%); }

.ap-copy {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: hsl(220, 10%, 65%);
  transition: background 0.2s, color 0.2s;
}
.ap-copy:hover { background: hsla(0, 0%, 100%, 0.08); color: #fff; }
.ap-copy .ico { width: 15px; height: 15px; }
.ap-copy.done { color: var(--ok); }

/* ---------- Options / Config ---------- */
.ap-config {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  margin-top: 40px;
  align-items: start;
}
.ap-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.ap-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ap-table th, .ap-table td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.ap-table tr:last-child td { border-bottom: 0; }
.ap-table th { font: 600 12px var(--font-heading); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); }
.ap-table td { color: var(--text-secondary); line-height: 1.6; }
.ap-table td:first-child { white-space: nowrap; }

/* ---------- Troubleshooting ---------- */
.ap-trouble {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 40px;
}
.ap-trouble h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 17px;
  margin-bottom: 10px;
}
.ap-trouble h3 .ico { color: var(--accent); }
.ap-trouble p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.ap-trouble strong { color: var(--text-primary); }

/* ---------- Changelog ---------- */
.ap-changes { display: grid; gap: 14px; margin: 28px 0; }
.ap-changes li {
  position: relative;
  padding-left: 26px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 15px;
}
.ap-changes li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.ap-changes strong { color: var(--text-primary); }

.ap-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
}
.ap-page p a.ap-link { text-decoration: none; }
.ap-link .ico { transition: transform 0.3s var(--ease-out); }
.ap-link:hover .ico { transform: translateX(4px); }

/* ---------- FAQ ---------- */
.ap-faq { margin-top: 36px; display: grid; gap: 12px; }
.ap-faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  transition: border-color 0.3s;
}
.ap-faq details[open] { border-color: var(--accent); }
.ap-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}
.ap-faq summary::-webkit-details-marker { display: none; }
.ap-faq summary h3 { font-family: var(--font-heading); font-size: 16.5px; font-weight: 600; }
.ap-faq summary .ico { color: var(--text-tertiary); transition: transform 0.3s var(--ease-out); }
.ap-faq details[open] summary .ico { transform: rotate(180deg); color: var(--accent); }
.ap-faq details p { padding: 0 22px 20px; color: var(--text-secondary); line-height: 1.75; font-size: 15px; }

/* ---------- Final CTA ---------- */
.ap-final {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(48px, 7vw, 80px) 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.ap-final .ap-hero-glow { top: -500px; right: auto; left: 50%; transform: translateX(-50%); }
.ap-final h2 {
  position: relative;
  font-family: var(--font-heading);
  font-size: clamp(30px, 4.5vw, 48px);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.ap-final > p { position: relative; color: var(--text-secondary); font-size: 17px; }
.ap-final .ap-cta { position: relative; }

/* ---------- Footer ---------- */
.ap-page .footer-copy { max-width: 640px; line-height: 1.6; }
.ap-page .footer-socials a { display: inline-flex; }

/* ---------- Sticky mobile bar ---------- */
.ap-sticky {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 998;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  transform: translateY(140%);
  visibility: hidden;
  transition: transform 0.4s var(--ease-out), visibility 0.4s;
}
.ap-sticky.show { transform: none; visibility: visible; }
.ap-sticky strong { display: block; font-family: var(--font-heading); font-size: 14px; }
.ap-sticky span { font: 12px var(--mono); color: var(--ok); }
.ap-sticky .btn { padding: 0.7rem 1.1rem; font-size: 14px; gap: 8px; }

/* ============================================
   LIGHT THEME TWEAKS
   ============================================ */
:root[data-theme="light"] .ap-code { background: hsl(220, 25%, 12%); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .ap-hero-inner,
  .ap-split,
  .ap-split-even,
  .ap-install,
  .ap-config { grid-template-columns: 1fr; }
  .ap-hero-visual { max-width: 620px; }
  .ap-features { grid-template-columns: repeat(2, 1fr); }
  .ap-devices { grid-template-columns: repeat(2, 1fr); }
  .ap-req { position: static; }
  .ap-trust { grid-template-columns: repeat(3, 1fr); }
  .ap-trust li:nth-child(3) { border-right: 0; }
  .ap-trust li:nth-child(n+4) { border-top: 1px solid var(--border); }
}

@media (max-width: 768px) {
  .ap-hero { padding-top: 104px; }
  .ap-page .nav .nav-cta { margin-left: 0; }
  .ap-steps,
  .ap-features,
  .ap-trouble { grid-template-columns: 1fr; }
  .ap-checks { grid-template-columns: 1fr; }
  .ap-trust { grid-template-columns: repeat(2, 1fr); }
  .ap-trust li { border-right: 1px solid var(--border) !important; border-top: 1px solid var(--border); }
  .ap-trust li:nth-child(-n+2) { border-top: 0; }
  .ap-trust li:nth-child(2n) { border-right: 0 !important; }
  .ap-trust li:last-child { grid-column: 1 / -1; border-right: 0 !important; }
  .ap-cta .btn { width: 100%; }
  .ap-sticky { display: flex; }
  .ap-page .footer { padding-bottom: 100px; }
  .ap-table td:first-child { white-space: normal; }
}

@media (max-width: 480px) {
  .ap-devices { grid-template-columns: 1fr; }
  .ap-faq summary { padding: 16px 18px; }
  .ap-faq details p { padding: 0 18px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .js-reveal { opacity: 1; transform: none; }
  .ap-flow * { animation: none !important; }
}
