/* PDF Master marketing site — hand-authored, build-free, RTL-aware.
   Uses logical properties (margin-inline, inset-*) so one stylesheet
   serves both LTR English and RTL Arabic. */

:root {
    --teal: #0f766e;
    --teal-600: #0d9488;
    --teal-700: #115e59;
    --ink: #0f172a;
    --muted: #5b6472;
    --line: #e2e8f0;
    --bg: #ffffff;
    --bg-soft: #f6f8f9;
    --radius: 16px;
    --wrap: 1120px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", "Segoe UI Arabic", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    font-size: 18px;
}

h1, h2, h3 { line-height: 1.25; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.muted { color: var(--muted); }

.skip {
    position: absolute; inset-inline-start: -999px; top: 0; z-index: 100;
    background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { inset-inline-start: 0; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 22px; border-radius: 12px; font-weight: 700;
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
    transition: transform .06s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 8px 24px rgba(15,118,110,.28); }
.btn-primary:hover { background: var(--teal-700); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ---- Header ---- */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255,255,255,.9);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
    background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
    color: #fff; font-size: .8rem; font-weight: 800; letter-spacing: .04em;
    padding: 5px 8px; border-radius: 8px;
}
.brand-name { font-size: 1.15rem; }
.site-nav { display: flex; align-items: center; gap: 22px; margin-inline-start: auto; }
.site-nav a { color: var(--ink); font-weight: 600; }
.site-nav a.active { color: var(--teal); }
.nav-cta { background: var(--teal); color: #fff !important; padding: 9px 16px; border-radius: 10px; }
.nav-cta:hover { background: var(--teal-700); text-decoration: none; }
.lang-switch { border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; font-size: .92rem; }

.nav-toggle, .nav-burger { display: none; }

/* ---- Hero ---- */
.hero {
    background:
        radial-gradient(1000px 400px at 80% -10%, rgba(13,148,136,.14), transparent),
        var(--bg-soft);
    padding: clamp(48px, 8vw, 96px) 0;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); margin: 18px 0 28px; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.trust { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-top: 26px; color: var(--muted); font-size: .95rem; }
.trust span { display: inline-flex; align-items: center; gap: 7px; }
.check { color: var(--teal); font-weight: 800; }
.phone-mock {
    aspect-ratio: 9/17; max-width: 300px; margin-inline: auto;
    border-radius: 34px; border: 10px solid #0f172a;
    background: linear-gradient(160deg, var(--teal-600), var(--teal-700));
    box-shadow: 0 30px 60px rgba(15,23,42,.28); position: relative; overflow: hidden;
}
.phone-mock .screen { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-align: center; padding: 20px; }
.phone-mock .screen strong { font-size: 1.5rem; display: block; }

/* ---- Sections ---- */
.section { padding: clamp(52px, 7vw, 88px) 0; }
.section.alt { background: var(--bg-soft); }
.section-head { max-width: 62ch; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.eyebrow { color: var(--teal); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; }

/* ---- Feature grid ---- */
.grid { display: grid; gap: 20px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: 0 12px 32px rgba(15,23,42,.08); transform: translateY(-2px); }
.card .ico {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    background: rgba(15,118,110,.1); color: var(--teal); font-size: 1.3rem; margin-bottom: 14px;
}
.card h3 { margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); }

/* ---- Callout ---- */
.callout {
    background: linear-gradient(135deg, var(--teal-700), var(--teal-600));
    color: #fff; border-radius: 24px; padding: clamp(32px, 5vw, 56px); text-align: center;
}
.callout h2 { color: #fff; }
.callout p { color: rgba(255,255,255,.9); max-width: 52ch; margin-inline: auto; }
.callout .btn-primary { background: #fff; color: var(--teal-700); box-shadow: none; }
.callout .btn-primary:hover { background: #f0fdfa; }

/* ---- FAQ ---- */
.faq-item { border: 1px solid var(--line); border-radius: 14px; padding: 4px 20px; margin-bottom: 12px; background: #fff; }
.faq-item summary { font-weight: 700; cursor: pointer; padding: 16px 0; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: inline-end; color: var(--teal); font-size: 1.4rem; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0 0 16px; color: var(--muted); }

/* ---- Prose (blog / legal) ---- */
.prose { max-width: 72ch; margin-inline: auto; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose li { color: #26303e; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; font-size: .92em; }

/* ---- Blog list ---- */
.post-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; color: inherit; }
.post-card:hover { text-decoration: none; box-shadow: 0 12px 32px rgba(15,23,42,.08); }
.post-card h3 { margin: 0 0 8px; }
.post-meta { color: var(--muted); font-size: .9rem; }

/* ---- Screens gallery ---- */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.shot { aspect-ratio: 9/17; border-radius: 20px; border: 8px solid #0f172a; background: linear-gradient(160deg, var(--teal-600), var(--teal-700)); color: #fff; display: grid; place-items: center; text-align: center; padding: 14px; font-weight: 600; }

/* ---- Download buttons ---- */
.store-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.store-btn { display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 700; }
.store-btn:hover { text-decoration: none; background: #1e293b; }
.store-btn.disabled { opacity: .5; pointer-events: none; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 48px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 12px; }
.site-footer nav a { display: block; color: var(--ink); padding: 4px 0; }
.footer-legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero .phone-mock { order: -1; }
    .cols-3 { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .nav-burger { display: flex; flex-direction: column; gap: 5px; cursor: pointer; margin-inline-start: auto; padding: 8px; }
    .nav-burger span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }
    .site-nav {
        position: fixed; inset-block: 64px 0; inset-inline-end: 0; width: min(80vw, 300px);
        flex-direction: column; align-items: stretch; gap: 6px; background: #fff;
        border-inline-start: 1px solid var(--line); padding: 20px; transform: translateX(100%);
        transition: transform .22s ease; box-shadow: -10px 0 40px rgba(0,0,0,.12);
    }
    html[dir="rtl"] .site-nav { transform: translateX(-100%); box-shadow: 10px 0 40px rgba(0,0,0,.12); }
    .nav-toggle:checked ~ .site-nav { transform: translateX(0); }
    .site-nav a { padding: 12px 8px; border-radius: 8px; }
    .site-nav a:hover { background: var(--bg-soft); }
}
@media (max-width: 560px) {
    .cols-3, .cols-2, .footer-grid { grid-template-columns: 1fr; }
    body { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   In-browser PDF tools — redesigned, large-type, RTL-aware
   ============================================================ */

/* Hero band (tools index + individual tool pages) */
.tool-hero {
    background: linear-gradient(180deg, #f0fdfa 0%, var(--bg) 100%);
    padding: 44px 0 10px;
    border-bottom: 1px solid var(--line);
}
.tool-hero h1 { margin: 6px 0 12px; }
.tool-hero-sub { font-size: 1.22rem; color: var(--muted); max-width: 720px; margin: 0; line-height: 1.5; }
.eyebrow { color: var(--teal); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; font-size: .82rem; margin: 0 0 6px; }

.crumbs { display: flex; gap: 8px; align-items: center; font-size: .98rem; margin-bottom: 16px; color: var(--muted); }
.crumbs a { color: var(--teal); font-weight: 700; }
.crumbs [aria-current] { color: var(--ink); }

.tool-hero-head { display: flex; flex-direction: column; }
.tool-hero-ico { font-size: 3.1rem; line-height: 1; margin-bottom: 8px; }

.trust-row { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 22px 0 4px; }
.trust-row li { font-weight: 700; color: var(--teal-700); font-size: 1.02rem; }

/* Tools index: category groups + big row cards */
.tool-section { padding-top: 36px; }
.tool-cat { margin-bottom: 44px; }
.tool-cat-title { font-size: 1.4rem; margin: 0 0 18px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tool-card2 {
    display: flex; align-items: center; gap: 16px; color: inherit;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px 22px; transition: border-color .15s, box-shadow .15s, transform .12s;
}
.tool-card2:hover { text-decoration: none; border-color: var(--teal); box-shadow: 0 12px 30px rgba(15,118,110,.13); transform: translateY(-2px); }
.tool-card2-ico { font-size: 1.9rem; width: 60px; height: 60px; flex: none; border-radius: 15px; display: grid; place-items: center; background: #f0fdfa; }
.tool-card2-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tool-card2-title { font-weight: 800; font-size: 1.18rem; color: var(--ink); }
.tool-card2-desc { color: var(--muted); font-size: 1rem; line-height: 1.4; }
.tool-card2-arrow { margin-inline-start: auto; color: var(--teal); font-size: 1.7rem; font-weight: 700; flex: none; }

/* Narrow workspace column */
.wrap-narrow { max-width: 720px; }

/* Step chips */
.steps { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.02rem; color: var(--ink); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 7px 18px 7px 7px; }
.step-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 1rem; flex: none; }

/* Interactive tool panel */
.card-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 10px 34px rgba(15,23,42,.06); }
.dropzone {
    border: 2px dashed var(--teal); border-radius: var(--radius);
    padding: 54px 20px; text-align: center; cursor: pointer; background: var(--bg-soft);
    transition: background .15s ease, border-color .15s ease;
}
.dropzone:hover, .dropzone:focus-visible { background: #ecfdf5; outline: 3px solid rgba(15,118,110,.25); outline-offset: 2px; }
.dropzone.over { background: #d1fae5; border-color: var(--teal-700); }
.dropzone .drop-ico { font-size: 3rem; display: block; margin-bottom: 14px; }
.drop-title { font-size: 1.3rem; margin: 2px 0; }
.drop-hint { font-size: 1.05rem; margin: 6px 0 0; }

.tool-options { margin: 22px 0 6px; }
.opt { display: block; }
.opt > span { display: block; font-weight: 700; margin-bottom: 8px; font-size: 1.06rem; }
.opt input, .opt select {
    width: 100%; padding: 15px 16px; border: 2px solid var(--line); border-radius: 12px;
    font: inherit; font-size: 1.05rem; background: #fff;
}
.opt input:focus, .opt select:focus { outline: none; border-color: var(--teal); }
.opt small { display: block; margin-top: 8px; font-size: .96rem; }

.btn-lg { font-size: 1.16rem; padding: 16px 30px; border-radius: 14px; }
.tool-run { margin-top: 16px; width: 100%; display: flex; align-items: center; justify-content: center; }
.tool-run:disabled { opacity: .5; cursor: not-allowed; }
.tool-status { margin-top: 16px; min-height: 1.3em; font-weight: 700; font-size: 1.06rem; }
.tool-status.ok { color: var(--teal-700); }
.tool-status.error { color: #b91c1c; }

.file-chips { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.file-chip { display: inline-flex; align-items: center; gap: 10px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 11px 15px; font-size: 1rem; }
.chip-x { border: none; background: none; font-size: 1.35rem; line-height: 1; cursor: pointer; color: var(--muted); }
.chip-x:hover { color: #b91c1c; }

.page-list-grid { list-style: none; padding: 0; margin: 18px 0 0; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.page-tile { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; align-items: center; justify-content: center; padding: 6px; cursor: grab; }
.page-tile.dragging { opacity: .5; }
.page-tile.removed { opacity: .35; outline: 2px solid var(--teal); }
.page-tile canvas { max-width: 100%; height: auto; transition: transform .15s ease; }
.page-num { position: absolute; inset-block-end: 5px; inset-inline-start: 5px; background: rgba(15,23,42,.78); color: #fff; font-size: .74rem; padding: 2px 7px; border-radius: 6px; }
.page-action { position: absolute; inset-block-start: 5px; inset-inline-end: 5px; border: none; background: rgba(255,255,255,.92); border-radius: 9px; cursor: pointer; font-size: 1.05rem; width: 34px; height: 34px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }

.tool-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; margin-top: 20px; }
.result-thumb { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: block; }
.result-thumb canvas { max-width: 100%; height: auto; display: block; }

/* How it works / related / FAQ */
.tool-how, .related, .faq { margin-top: 48px; }
.tool-how h2, .related h2, .faq h2 { margin: 0 0 14px; }
.tool-how p { font-size: 1.1rem; color: var(--muted); line-height: 1.65; }

.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.related-card { display: flex; align-items: center; gap: 11px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; color: var(--ink); font-weight: 700; font-size: 1.02rem; transition: border-color .15s, box-shadow .15s; }
.related-card:hover { border-color: var(--teal); text-decoration: none; box-shadow: 0 8px 22px rgba(15,118,110,.1); }
.related-ico { font-size: 1.45rem; }

.faq-item { border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; margin-bottom: 12px; background: #fff; }
.faq-item summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; padding: 18px 0; display: flex; justify-content: space-between; align-items: center; gap: 14px; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--teal); font-size: 1.5rem; font-weight: 700; flex: none; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { margin: 0 0 20px; color: var(--muted); font-size: 1.06rem; line-height: 1.65; }

.callout-lg { margin-top: 48px; }
.callout-cta { margin-top: 22px; }
