/* =========================================================
   PDFCompressor — minimalist landing page
   Vanilla CSS · light/dark theme · no frameworks
   ========================================================= */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --text: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --accent: #0ea5e9;           /* matches app blue */
  --accent-strong: #0284c7;
  --accent-soft: rgba(14, 165, 233, 0.09);
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.04), 0 8px 30px rgba(24, 24, 27, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0d0d0f;
  --surface: #161618;
  --surface-2: #1d1d20;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --border: #27272a;
  --accent: #38bdf8;
  --accent-strong: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, 0.10);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 40px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }

/* ---------- Windows Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 6px;
}
.badge--windows {
  color: #0078d4;
  background: rgba(0,120,212,0.10);
  border: 1px solid rgba(0,120,212,0.18);
}

/* ---------- Platform strip (hero) ---------- */
.hero__platform {
  display: flex; align-items: center; gap: 10px;
  justify-content: center; margin-top: 24px;
  font-size: 0.85rem; color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
    border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  white-space: nowrap;
}
.btn--sm { padding: 9px 16px; font-size: 0.875rem; }
.btn--lg { padding: 16px 32px; font-size: 1rem; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 22px var(--accent-soft);
}
.btn--primary:hover { background: var(--accent-strong); transform: translateY(-2px); }
.btn--primary:active { transform: translateY(0) scale(0.98); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn--text {
  background: transparent;
  color: var(--muted);
  padding-inline: 8px;
}
.btn--text:hover { color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand__mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  overflow: hidden;
}
.brand__name { font-size: 1.02rem; }
.nav__links { display: flex; align-items: center; gap: 22px; }
.nav__links > a:not(.btn) { color: var(--muted); font-size: 0.92rem; transition: color 0.2s var(--ease); }
.nav__links > a:not(.btn):hover { color: var(--text); }

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.theme-toggle:hover { transform: rotate(12deg); border-color: var(--accent); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero { padding: clamp(64px, 12vw, 128px) 24px clamp(48px, 8vw, 88px); text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin: 0 0 18px;
}
.hero__title { font-size: clamp(2.4rem, 7vw, 4.4rem); font-weight: 600; }
.hero__lead {
  max-width: 56ch; margin: 22px auto 0;
  font-size: clamp(1rem, 2.2vw, 1.18rem); color: var(--muted);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 34px; }
.hero__note { margin-top: 22px; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.01em; }

/* ---------- Section heads ---------- */
.section-head { text-align: center; max-width: 56ch; margin: 0 auto clamp(28px, 5vw, 48px); }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.section-head p { margin: 12px 0 0; color: var(--muted); }

/* ---------- Showcase — theme-aware screenshot (seamless, no double-frame) ---------- */
.showcase { padding: clamp(40px, 7vw, 80px) 24px; }

/* Minimal wrapper: screenshot is the visual, bg matches screenshot edge color */
.showcase__frame {
  max-width: 960px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  /* Background matches the screenshot's own corner color so rounded edges blend seamlessly */
  background: #ebebeb;   /* light screenshot top-left corner */
  box-shadow:
    0 4px 20px rgba(0,0,0,0.07),
    0 12px 36px rgba(0,0,0,0.04);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), background-color 0.35s var(--ease);
}
[data-theme="dark"] .showcase__frame {
  background: #242424;   /* dark screenshot top-left corner */
  box-shadow:
    0 4px 24px rgba(0,0,0,0.35),
    0 12px 44px rgba(0,0,0,0.18);
}
.showcase__frame:hover {
  transform: translateY(-4px);
  box-shadow:
    0 8px 28px rgba(0,0,0,0.09),
    0 16px 48px rgba(0,0,0,0.06);
}

/* Screenshot viewport — image bleeds to frame edge, no gap */
.showcase__viewport {
  position: relative;
  line-height: 0;
  overflow: hidden;
}

/* Theme-switched images: only the matching one is visible, fills container */
.screenshot-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: opacity 0.35s var(--ease);
}
.screenshot--light { display: block; }
.screenshot--dark { display: none; }

/* In dark mode: show dark screenshot, hide light */
[data-theme="dark"] .screenshot--light { display: none; }
[data-theme="dark"] .screenshot--dark { display: block; }

/* Windows badge overlay on screenshot corner — removed, caused ghosting with screenshot content */

/* Callout below screenshot frame */
.showcase__callout {
  display: flex; align-items: flex-start; gap: 13px;
  max-width: 640px; margin: 36px auto 0; padding: 18px 22px;
  border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border);
}
.showcase__callout-icon {
  color: var(--accent); flex-shrink: 0; margin-top: 1px;
}
.showcase__callout p { margin: 0; font-size: 0.93rem; line-height: 1.55; color: var(--muted); }
.showcase__callout strong { color: var(--text); }

/* ---------- Features ---------- */
.features { padding: clamp(40px, 7vw, 72px) 24px; }
.feature-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(3, 1fr);
}
.feature {
  padding: 30px 26px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.feature:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: var(--shadow); }
.feature__dot {
  display: block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); margin-bottom: 18px;
}
.feature h3 { font-size: 1.15rem; margin-bottom: 10px; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Buy / Payment — complete flow states ---------- */
.buy { padding: clamp(48px, 8vw, 88px) 24px clamp(64px, 10vw, 110px); }
.buy__card {
  max-width: 520px; margin-inline: auto;
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid var(--border); border-radius: 22px;
  background: var(--surface); box-shadow: var(--shadow); text-align: center;
  position: relative; overflow: hidden;
}

/* Step visibility transitions */
.buy__step {
  animation: fadeUp 0.45s var(--ease) both;
}
.buy__step[hidden] {
  display: none !important;
}

.buy__title { font-size: clamp(1.6rem, 4vw, 2.1rem); margin-top: 6px; }
.buy__price { margin: 16px 0 28px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.buy__amount { font-size: 2.6rem; font-weight: 600; letter-spacing: -0.03em; }
.buy__term { font-size: 0.85rem; color: var(--muted); }

.buy__form { text-align: left; }
.field { margin-bottom: 22px; }
.field label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 8px; }
.field input {
  width: 100%; font-family: inherit; font-size: 1rem;
  padding: 13px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background-color 0.2s var(--ease);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input.is-invalid { border-color: #e5484d; }
.field__error { margin: 8px 0 0; font-size: 0.82rem; color: #e5484d; }

/* ---------- PayPal Button — matches official design (image ref) ---------- */
.pay-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  text-decoration: none;
  width: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em;
  padding: 15px 28px; border-radius: 50px;
  border: none; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #0085cc 0%, #0070ba 30%, #1546a0 70%, #001c64 100%);
  box-shadow:
    0 2px 4px rgba(0,112,186,0.20),
    0 6px 18px rgba(0,28,100,0.25),
    0 12px 32px rgba(0,28,100,0.14);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), filter 0.2s var(--ease);
  position: relative; overflow: hidden;
}
/* Subtle shine sweep on hover */
.pay-btn::after {
  content: "";
  position: absolute; top: 0; left: -60%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
  transform: skewX(-16deg);
  opacity: 0; transition: left 0.5s ease, opacity 0.3s ease;
}
.pay-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 8px rgba(0,112,186,0.24),
    0 10px 26px rgba(0,28,100,0.30),
    0 16px 40px rgba(0,28,100,0.18);
  filter: brightness(1.05);
}
.pay-btn:hover::after { left: 120%; opacity: 1; }
.pay-btn:active { transform: translateY(0) scale(0.98); }
.pay-btn:disabled, .pay-btn.is-disabled {
  opacity: 0.45; cursor: not-allowed;
  transform: none !important; box-shadow: none !important;
  filter: grayscale(0.3);
  pointer-events: none;
}

/* PayPal logo inside the button — pre-cut transparent white PNG */
.pay-btn__logo {
  flex-shrink: 0;
  height: 22px; width: auto;
  object-fit: contain;
}

.paypal-wrap { min-height: 54px; }
.paypal-hint { text-align: center; font-size: 0.78rem; color: var(--muted); margin: 12px 0 0; }
.paypal-lock { display: none; margin: 10px 0 0; font-size: 0.8rem; color: var(--muted); text-align: center; }
.paypal-lock.is-visible { display: block; }

/* Processing state */
.buy__processing { text-align: center; padding: 30px 0 20px; }
.spinner-wrap { display: flex; justify-content: center; margin: 28px 0 16px; }
.spinner {
  display: block; width: 44px; height: 44px;
  border: 3.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.buy__processing-text { color: var(--muted); font-size: 0.94rem; }

/* Success state */
.buy__success { text-align: center; animation: fadeUp 0.5s var(--ease) both; }
.buy__check {
  display: inline-grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(34, 197, 94, 0.10); color: #22c55e; margin-bottom: 16px;
  animation: popIn 0.4s var(--ease) 0.1s both;
}
@keyframes popIn { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.buy__success h3 { font-size: 1.3rem; margin-bottom: 8px; }
.buy__success > p { color: var(--muted); margin: 0 0 24px; font-size: 0.97rem; }
.buy__receipt {
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border); text-align: left;
}
.buy__receipt p { margin: 6px 0; font-size: 0.87rem; color: var(--muted); line-height: 1.5; }
.buy__receipt strong { color: var(--text); }

/* ---------- QR Payment Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.25s var(--ease) both;
}
.modal-overlay[hidden] { display: none !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.qr-modal {
  width: min(420px, 90vw);
  padding: 36px 32px 32px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow:
    0 4px 24px rgba(0,0,0,0.12),
    0 16px 56px rgba(0,0,0,0.10),
    0 32px 80px rgba(0,0,0,0.06);
  text-align: center;
  animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.qr-modal__instruction {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 28px;
}
.qr-modal__instruction strong { color: var(--accent); font-weight: 600; }

.qr-modal__code-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 2px solid var(--border);
}

.qr-modal__code {
  display: block; width: 200px; height: 200px; object-fit: contain;
  image-rendering: pixelated;
}

.qr-modal__note {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 26px;
}
.qr-modal__note strong { color: var(--text); }

.qr-modal__confirm {
  width: 100%;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 24px; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; color: var(--muted); }
.footer__links { display: flex; gap: 18px; }
.footer__links a:hover { color: var(--accent); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .feature-grid { grid-template-columns: 1fr; }
  .nav__links > a:not(.btn) { display: none; }
  .nav__links .btn { display: inline-flex; }
  .buy__card { padding: 28px 20px; }
  .showcase__badge { font-size: 0.65rem; padding: 2px 7px; }
  .hero__platform { flex-direction: column; gap: 4px; }
  /* QR modal on small screens */
  .qr-modal { width: min(360px, 88vw); padding: 28px 22px 24px; margin-inline: 12px; }
  .qr-modal__code-wrap { padding: 10px; }
  .qr-modal__code { width: 170px; height: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .feature, .theme-toggle, .pay-btn, .showcase__frame, .qr-modal { transition: none; }
  .spinner { animation-duration: 2s; }
  .buy__check, .buy__step { animation: none; opacity: 1; transform: none; }
}

/* =========================================================
   Language selector (top-right, next to theme toggle)
   ========================================================= */
.nav__tools { display: flex; align-items: center; gap: 12px; }

.lang-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  font-family: inherit; font-size: 0.85rem; font-weight: 500;
  color: var(--text);
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 30px 8px 14px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.lang-select:hover { border-color: var(--accent); }
.lang-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* =========================================================
   Right-to-Left (Arabic / Saudi)
   ========================================================= */
[dir="rtl"] body {
  font-family: "Noto Sans Arabic", "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[dir="rtl"] .badge { letter-spacing: 0; }
/* Flip the leading SVG/icon to the correct side automatically via flex;
   nothing else required — flex/gap already mirror under RTL. */

@media (max-width: 760px) {
  .lang-select { padding: 7px 26px 7px 11px; font-size: 0.8rem; background-position: right 8px center; }
  .nav__tools { gap: 8px; }
}
