/* ==========================================================================
   PRP Landing Page — Styles
   Minimal, modern, high-contrast. Light + Dark. LTR + RTL.
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  --accent: #10b981;        /* emerald */
  --accent-hover: #059669;
  --accent-soft: rgba(16, 185, 129, 0.12);

  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --surface: #ffffff;
  --border: #e6e8ec;
  --text: #0a0a0a;
  --text-muted: #5a6170;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.04), 0 1px 3px rgba(10, 10, 10, 0.06);
  --shadow-md: 0 4px 16px rgba(10, 10, 10, 0.06), 0 2px 6px rgba(10, 10, 10, 0.04);
  --shadow-lg: 0 20px 60px rgba(10, 10, 10, 0.10), 0 8px 24px rgba(10, 10, 10, 0.06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --container: 1200px;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-ar: 'Cairo', 'Inter', system-ui, sans-serif;

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-alt: #111215;
  --surface: #141518;
  --border: #24262b;
  --text: #f5f5f5;
  --text-muted: #9aa0ab;
  --accent-soft: rgba(16, 185, 129, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}

html[lang="ar"] body { font-family: var(--font-ar); }

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

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

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.header.scrolled { border-bottom-color: var(--border); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand:hover { color: inherit; }
.brand__mark { display: inline-flex; }

.nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
}
.nav a:hover { color: var(--text); }

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
}
.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); color: inherit; }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 6px 20px -6px var(--accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  color: #000;
  box-shadow: 0 10px 24px -6px var(--accent);
}

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

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 64px;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -20% 0 auto 0;
  height: 520px;
  background: radial-gradient(ellipse at center top, var(--accent-soft), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}

.pill {
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero__title {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hero__title .accent { color: var(--accent); }
.hero__title span { display: inline-block; margin-right: 0.25em; }
html[dir="rtl"] .hero__title span { margin-right: 0; margin-left: 0.25em; }

.hero__sub {
  margin-top: 20px;
  font-size: 18px;
  color: var(--text-muted);
  max-width: 540px;
}

.hero__cta {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero__meta {
  margin-top: 40px;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.hero__meta-item { display: flex; flex-direction: column; gap: 2px; }
.hero__meta-item strong { font-size: 22px; font-weight: 800; }
.hero__meta-item span { font-size: 13px; color: var(--text-muted); }

/* Hero mockup */
.hero__visual {
  position: relative;
  aspect-ratio: 4/3;
}
.hero__glow {
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle at center, var(--accent-soft), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}

.mock {
  position: relative;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.mock__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.mock__bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border);
}
.mock__bar span:first-child { background: var(--accent); }

.mock__body { display: grid; grid-template-columns: 140px 1fr; height: calc(100% - 45px); }
.mock__side {
  padding: 16px 12px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
html[dir="rtl"] .mock__side { border-right: 0; border-left: 1px solid var(--border); }
.mock__row {
  height: 14px;
  border-radius: 6px;
  background: var(--bg-alt);
}
.mock__row--active { background: var(--accent-soft); }

.mock__main {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mock__card {
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  height: 60px;
}
.mock__card--tall { height: 110px; background: linear-gradient(135deg, var(--accent-soft), var(--bg-alt)); }
.mock__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Sections ---------- */
.section {
  padding: 96px 0;
}
.section--alt {
  background: var(--bg-alt);
}

.section__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.section__head h2 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.025em;
}
.section__head p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 17px;
}

/* ---------- Screenshots (carousel) ---------- */
.shots {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.shots__track {
  flex: 1;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.shots__track::-webkit-scrollbar { display: none; }

.shot {
  flex: 0 0 calc(50% - 10px);
  scroll-snap-align: center;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}
.shot:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.shot img { width: 100%; height: auto; display: block; }
.shot figcaption {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.shots__nav {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.shots__nav:hover { border-color: var(--accent); color: var(--accent); }
html[dir="rtl"] .shots__nav svg { transform: scaleX(-1); }

.shots__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.shots__dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all var(--transition);
}
.shots__dots button.is-active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

/* ---------- Features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
}
.feature:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}

.feature h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- Platforms ---------- */
.platforms {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.platform {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition);
  color: var(--text);
}
.platform h3 { font-size: 16px; font-weight: 600; }

.platform--active { cursor: pointer; }
.platform--active:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.platform--soon { opacity: 0.7; cursor: default; }

.platform__status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.platform__status--live {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  background: var(--bg);
}
.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: center;
}
.footer__brand p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.footer__links {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--text-muted);
}
.footer__copy {
  text-align: end;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- RTL Adjustments ---------- */
html[dir="rtl"] .hero__cta,
html[dir="rtl"] .hero__meta,
html[dir="rtl"] .nav,
html[dir="rtl"] .footer__links {
  direction: rtl;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { padding: 56px 0 32px; }
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__visual { max-width: 560px; margin: 0 auto; width: 100%; }

  .features { grid-template-columns: repeat(2, 1fr); }
  .platforms { grid-template-columns: repeat(3, 1fr); }

  .shot { flex: 0 0 80%; }

  .section { padding: 72px 0; }

  .footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer__brand, .footer__links { justify-content: center; display: flex; flex-direction: column; align-items: center; }
  .footer__links { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .footer__copy { text-align: center; }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .header__inner { height: 60px; }

  .hero__title { font-size: clamp(32px, 9vw, 44px); }
  .hero__sub { font-size: 16px; }
  .hero__meta { gap: 24px; }

  .features { grid-template-columns: 1fr; }
  .platforms { grid-template-columns: repeat(2, 1fr); }

  .shot { flex: 0 0 88%; }
  .shots__nav { display: none; }

  .btn { padding: 12px 18px; font-size: 14px; }
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
