/*
 * mawaqi.app directory — one stylesheet, no web fonts (mawaqi.ai loads none
 * either; the stacks below match its globals.css). Colours are the mawaqi.ai
 * brand tokens: purple + gold on warm parchment. Logical properties
 * (inline-start/end) keep one rule set working for RTL and LTR.
 */

:root {
  --purple-50: #f6f1fb;
  --purple-100: #ece0f5;
  --purple-300: #b88ed3;
  --purple-500: #7b3fa3;
  --purple-600: #62307f;
  --purple-700: #4e2666;
  --purple-800: #3a1c4c;
  --gold-100: #f4e7ca;
  --gold-300: #d9b05e;
  --gold-400: #c8954a;
  --gold-700: #6b4920;

  --bg: #faf7f2;
  --bg-sunken: #f3ede3;
  --surface: #ffffff;
  --border: #e7dfd0;
  --border-strong: #d4c8b2;
  --text: #1d1426;
  --text-muted: #5a4d63;
  --text-subtle: #72618a;
  --accent: var(--purple-600);
  --accent-hover: var(--purple-700);
  --accent-text: #ffffff;
  --link: var(--purple-600);
  --pill-bg: var(--gold-100);
  --pill-text: var(--gold-700);
  --band-bg: #1a0f22;
  --band-text: #faf7f2;
  --band-muted: #d6c8e0;
  --shadow-sm: 0 1px 2px rgba(29, 20, 38, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(58, 28, 76, 0.28);
  --ring: 0 0 0 3px rgba(98, 48, 127, 0.35);

  --font-ar: "Tajawal", "Noto Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --font-en: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  --font-display: Fraunces, "Plus Jakarta Sans", Georgia, serif;
  --radius: 16px;
  --container: 1180px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #140819;
    --bg-sunken: #1b0f22;
    --surface: #21132b;
    --border: #36243f;
    --border-strong: #4a3456;
    --text: #f4eef8;
    --text-muted: #c9bad3;
    --text-subtle: #a996b7;
    --accent: var(--purple-500);
    --accent-hover: #8d4fb6;
    --link: var(--purple-300);
    --pill-bg: rgba(200, 149, 74, 0.18);
    --pill-text: var(--gold-300);
    --band-bg: #2a1636;
    --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --ring: 0 0 0 3px rgba(184, 142, 211, 0.45);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-en);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

[lang="en"] {
  font-family: var(--font-en);
}

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

a {
  color: var(--link);
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

:focus-visible {
  /* Transparent, not none: forced-colors mode drops box-shadow but paints
     the outline, so keyboard focus stays visible in High Contrast. */
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--ring);
  border-radius: 8px;
}

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

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-text);
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

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

.container.narrow {
  max-width: 820px;
}

@media (min-width: 720px) {
  :root {
    --gutter: 24px;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 14px;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 26px;
  font-size: 16px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

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

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--link);
}

.btn-gold {
  background: var(--gold-400);
  color: #1d1426;
}

.btn-gold:hover {
  background: var(--gold-300);
}

.btn-ghost-light {
  background: transparent;
  color: var(--band-text);
  border-color: rgba(250, 247, 242, 0.35);
}

.btn-ghost-light:hover {
  border-color: var(--band-text);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.brand-name {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.brand-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
}

.header-nav {
  display: none;
  gap: 4px;
  margin-inline-start: 12px;
}

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 10px;
}

.header-nav a:hover {
  color: var(--text);
  background: var(--bg-sunken);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

.lang-switch {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
}

.lang-switch:hover {
  color: var(--text);
  background: var(--bg-sunken);
}

@media (min-width: 900px) {
  .header-nav {
    display: flex;
  }
}

@media (max-width: 420px) {
  .brand-badge {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: 48px 56px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 520px;
  background:
    radial-gradient(40% 60% at 80% 30%, rgba(123, 63, 163, 0.16), transparent 70%),
    radial-gradient(35% 50% at 15% 10%, rgba(200, 149, 74, 0.18), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  gap: 40px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: var(--pill-text);
  background: var(--pill-bg);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(32px, 6vw, 54px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

[lang="en"] .hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
}

.lead {
  margin-top: 18px;
  font-size: clamp(17px, 2.2vw, 19px);
  color: var(--text-muted);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin: 32px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.stats div {
  display: flex;
  flex-direction: column-reverse;
}

.stats dt {
  font-size: 14px;
  color: var(--text-subtle);
}

.stats dd {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.hero-collage {
  position: relative;
  min-height: 300px;
}

.hero-frame {
  position: absolute;
  width: 78%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
}

.hero-frame-1 {
  inset-inline-start: 0;
  top: 0;
  z-index: 3;
}

.hero-frame-2 {
  inset-inline-end: 0;
  top: 22%;
  z-index: 2;
  transform: rotate(2.5deg);
}

.hero-frame-3 {
  inset-inline-start: 10%;
  top: 46%;
  z-index: 1;
  transform: rotate(-2deg);
}

@media (min-width: 900px) {
  .hero {
    padding-block: 72px 88px;
  }
  .hero-inner {
    grid-template-columns: 1.05fr 1fr;
    gap: 56px;
  }
  .hero-collage {
    min-height: 460px;
  }
}

@media (max-width: 899px) {
  .hero-collage {
    aspect-ratio: 4 / 3;
    min-height: 0;
  }
}

/* ---------- Browser bar (cards + hero) ---------- */

.browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding-inline: 12px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
}

.browser-dots {
  display: inline-flex;
  gap: 5px;
  flex: none;
}

.browser-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.browser-host {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: start;
}

/* ---------- Sections ---------- */

.directory,
.how,
.faq {
  padding-block: 56px;
}

.section-head {
  max-width: 720px;
  margin-bottom: 28px;
}

.section-head h2,
.faq h2 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

[lang="en"] .section-head h2,
[lang="en"] .faq h2 {
  font-family: var(--font-display);
  font-weight: 600;
}

.section-head p {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 17px;
}

/* ---------- Directory ---------- */

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-block: 2px;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--text-subtle);
}

.search svg {
  position: absolute;
  inset-inline-start: 14px;
  pointer-events: none;
}

.search input {
  width: 100%;
  min-height: 46px;
  padding-block: 10px;
  padding-inline: 42px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.search input::placeholder {
  color: var(--text-subtle);
}

.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

@media (min-width: 900px) {
  .toolbar {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
  }
  .chips {
    flex-wrap: wrap;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  .search {
    flex: 0 0 300px;
  }
}

.result-count {
  font-size: 14px;
  color: var(--text-subtle);
  margin-bottom: 18px;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 22px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card:has(.card-link:focus-visible) {
  box-shadow: var(--ring);
  outline: 2px solid transparent;
}

.card-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  background: var(--bg-sunken);
}

.card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px 18px 20px;
  flex: 1;
}

.pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
}

.card-title {
  font-size: 19px;
  font-weight: 800;
}

.card-link {
  color: var(--text);
  text-decoration: none;
}

/* The whole card is the link target (one tab stop, one accessible name). */
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card-link:focus-visible {
  box-shadow: none;
}

.card-desc {
  color: var(--text-muted);
  font-size: 15px;
}

.card-visit {
  margin-top: auto;
  padding-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--link);
}

[dir="rtl"] .icon-arrow {
  transform: scaleX(-1);
}

.empty {
  text-align: center;
  padding: 40px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.empty p {
  margin-bottom: 16px;
}

/* ---------- How it works ---------- */

/* White feature cards with a tinted icon tile, on the page background. */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px;
}

@media (min-width: 820px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(28px, 3.2vw, 42px);
}

.step-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: var(--purple-50);
  color: var(--purple-700);
  margin-bottom: 36px;
}

@media (prefers-color-scheme: dark) {
  .step-icon {
    background: rgba(123, 63, 163, 0.22);
    color: var(--purple-100);
  }
}

.step h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.step p {
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.75;
}

.how-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- Get listed ---------- */

.listing {
  padding-block: 56px 0;
}

.listing-card {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: 32px 24px;
  border-radius: 24px;
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(200, 149, 74, 0.25), transparent 60%),
    var(--band-bg);
  color: var(--band-text);
}

.listing-card h2 {
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 800;
}

[lang="en"] .listing-card h2 {
  font-family: var(--font-display);
  font-weight: 600;
}

.listing-card p {
  margin-top: 10px;
  color: var(--band-muted);
  max-width: 60ch;
}

.listing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (min-width: 900px) {
  .listing-card {
    grid-template-columns: 1fr auto;
    padding: 40px 48px;
  }
}

/* ---------- FAQ ---------- */

.faq h2 {
  margin-bottom: 24px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 20px;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex: none;
  font-size: 22px;
  line-height: 1;
  color: var(--link);
  transition: transform 0.15s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding-bottom: 18px;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
}

.footer-inner {
  display: grid;
  gap: 32px;
  padding-block: 48px 32px;
}

@media (min-width: 820px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 15px;
  max-width: 44ch;
}

.footer-col h2 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
}

.footer-col a:hover {
  color: var(--link);
  text-decoration: underline;
}

.footer-legal {
  padding-block: 18px 28px;
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 13px;
}

/* ---------- 404 ---------- */

.not-found {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  padding: 24px 16px;
}

.not-found h1 {
  font-size: 30px;
  font-weight: 800;
}

.not-found h2 {
  font-size: 22px;
  margin: 18px 0 12px;
}
