/* Rafeq landing page — Emerald theme aligned with AppTheme.swift */

:root {
  --bg-deep: #061a1a;
  --bg: #0a2e2e;
  --bg-elevated: #133b3b;
  --accent: #2ec4b6;
  --accent-soft: rgba(46, 196, 182, 0.18);
  --accent-glow: rgba(46, 196, 182, 0.35);
  --gold: #d4a04a;
  --gold-soft: rgba(212, 160, 74, 0.2);
  --text: #f4fbfb;
  --text-secondary: rgba(244, 251, 251, 0.78);
  --text-muted: rgba(244, 251, 251, 0.55);
  --stroke: rgba(46, 196, 182, 0.22);
  --glass: rgba(19, 59, 59, 0.55);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", serif;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

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

:focus {
  outline: none;
}

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

.nav-cta:focus-visible,
.btn:focus-visible,
.store-badge:focus-visible,
.legal-nav a:focus-visible,
.menu-toggle:focus-visible {
  outline-offset: 2px;
}

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* Background atmosphere */

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(46, 196, 182, 0.16), transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 20%, rgba(212, 160, 74, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 40%, var(--bg-deep) 100%);
}

.page-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(46, 196, 182, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
}

.page-bg::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  top: 8%;
  right: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 68%);
  filter: blur(40px);
  opacity: 0.5;
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-40px, 30px) scale(1.08); }
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(6, 26, 26, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.header-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-inline-start: auto;
}

.nav a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--stroke);
  color: var(--text) !important;
  white-space: nowrap;
}

.nav-cta:hover {
  background: rgba(46, 196, 182, 0.28);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  color: var(--text);
}

/* Hero */

.hero {
  padding: 4.5rem 0 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid rgba(212, 160, 74, 0.28);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 1.2rem 0 1rem;
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-lead {
  margin: 0 0 2rem;
  max-width: 34rem;
  color: var(--text-secondary);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #35d4c5, var(--accent));
  color: #042424;
  box-shadow: 0 12px 32px rgba(46, 196, 182, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 16px 40px rgba(46, 196, 182, 0.38);
}

.btn-secondary {
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--text);
}

/* Phone mockup */

.device-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
}

.device-glow {
  position: absolute;
  inset: 10% 5%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 196, 182, 0.22), transparent 70%);
  filter: blur(24px);
}

.phone {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 9 / 19.5;
  border-radius: 42px;
  padding: 12px;
  background: linear-gradient(160deg, #1a4545, #0b2222);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.phone-screen {
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: #061a1a;
}

/* Sections */

section {
  padding: 4.5rem 0;
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 500;
  line-height: 1.15;
}

.section-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.feature-card {
  padding: 1.4rem;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(46, 196, 182, 0.4);
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.platforms {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.platform-card {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.platform-card .icon {
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
}

.platform-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.platform-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pro-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, rgba(46, 196, 182, 0.1), rgba(212, 160, 74, 0.06)),
    var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.pro-panel h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 500;
}

.pro-panel p {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
}

.pro-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.pro-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.pro-list li::before {
  content: "✦";
  color: var(--gold);
  line-height: 1.4;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.trust-card {
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.trust-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
}

.trust-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.cta-band {
  text-align: center;
  padding: 3.5rem 2rem;
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, rgba(46, 196, 182, 0.12), rgba(46, 196, 182, 0.04));
  border: 1px solid var(--stroke);
}

.cta-band h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.cta-band p {
  margin: 0 auto 1.5rem;
  max-width: 32rem;
  color: var(--text-secondary);
}

/* Footer */

.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-brand p {
  margin: 0.5rem 0 0;
  max-width: 22rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  width: 100%;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Responsive */

@media (max-width: 960px) {
  .hero-grid,
  .pro-panel {
    grid-template-columns: 1fr;
  }

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

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

  .device-stage {
    min-height: auto;
    margin-top: 1rem;
  }
}

@media (max-width: 720px) {
  .nav {
    display: none;
    margin-inline-start: 0;
  }

  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 1rem 1.25rem 1.25rem;
    background: rgba(6, 26, 26, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .brand span {
    display: none;
  }

  .header-tools {
    margin-inline-start: auto;
    gap: 0.45rem;
  }

  .lang-switch {
    gap: 0.28rem;
    font-size: 0.78rem;
  }

  .legal-nav {
    flex-wrap: wrap;
  }

  .legal-nav a {
    flex: 1 1 calc(50% - 0.4rem);
  }

  .menu-toggle {
    display: grid;
    place-items: center;
  }

  .site-header .container {
    position: relative;
  }

  .feature-grid,
  .trust-grid,
  .platforms {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .page-bg::after {
    animation: none;
  }

  .btn:hover,
  .feature-card:hover {
    transform: none;
  }
}

/* SVG sprite + icons */

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1rem;
}

.feature-icon--gold {
  color: var(--gold);
  background: var(--gold-soft);
}

.platform-card .icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 0.6rem;
  color: var(--accent);
}

/* Language switcher */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  color: var(--text-muted);
}

.lang-switch a:hover,
.lang-switch a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.lang-switch span {
  color: var(--stroke);
}

/* App Store badge */

.store-badge {
  display: inline-block;
  line-height: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.store-badge:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.store-badge img,
.store-badge svg {
  height: 52px;
  width: auto;
}

/* Screenshot gallery */

.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.shot-card {
  margin: 0;
}

.shot-frame {
  aspect-ratio: 472 / 1024;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  background: #061a1a;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.shot-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.phone-screen--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.shot-card figcaption {
  margin-top: 0.85rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* RTL (Arabic) */

html.rtl {
  --font-sans: "IBM Plex Sans Arabic", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Amiri", "Cormorant Garamond", "Iowan Old Style", serif;
}

html.rtl body {
  font-family: var(--font-sans);
}

html.rtl h1,
html.rtl h2,
html.rtl h3 {
  font-family: var(--font-serif);
}

html.rtl h1 em {
  font-style: normal;
  color: var(--accent);
}

html.rtl .eyebrow {
  letter-spacing: 0;
}

html.rtl .pro-list li::before {
  order: 1;
}

html.rtl .pro-list li {
  flex-direction: row-reverse;
  text-align: right;
}

@media (max-width: 960px) {
  .screenshot-gallery {
    grid-template-columns: 1fr;
    max-width: 300px;
    margin-inline: auto;
  }
}

/* Legal pages */

.legal-page main {
  padding: 3rem 0 4rem;
}

.legal-doc {
  max-width: 720px;
  margin-inline: auto;
  padding: 2rem;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
}

.legal-doc h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 500;
  line-height: 1.15;
}

.legal-doc .legal-updated {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.legal-doc h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.legal-doc h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.legal-doc p,
.legal-doc li {
  color: var(--text-secondary);
}

.legal-doc ul {
  padding-left: 1.25rem;
}

.legal-doc a {
  color: var(--accent);
}

.legal-doc a:hover {
  text-decoration: underline;
}

.legal-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.legal-nav a {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-align: center;
  white-space: nowrap;
}

.legal-nav a:hover,
.legal-nav a[aria-current="page"] {
  color: var(--text);
  border-color: rgba(46, 196, 182, 0.4);
  background: var(--accent-soft);
}

.legal-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

html.rtl .legal-doc ul {
  padding-right: 1.25rem;
  padding-left: 0;
}
