/* 313 Tech & Ismah: shared styles. Dark by default, light when the device asks for it. */

:root {
  --bg: #0d1210;
  --bg-2: #111815;
  --surface: #151d19;
  --surface-2: #1b2520;
  --line: #26332d;
  --text: #ecf3ef;
  --muted: #9db1a8;
  --soft: #6f8279;
  --green: #2ecc71;
  --green-deep: #1f9e57;
  --on-green: #06170d;
  --gold: #e6c280;
  --coral: #ff6b6b;
  --glow: rgba(46, 204, 113, 0.18);
  --star: rgba(230, 194, 128, 0.07);
  --radius: 22px;
  --max: 1120px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --arabic: "Scheherazade New", "Amiri", serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f8f7;
    --bg-2: #eef3f0;
    --surface: #ffffff;
    --surface-2: #f1f5f3;
    --line: #dce5e0;
    --text: #13201a;
    --muted: #4f6158;
    --soft: #74857d;
    --green: #17a85a;
    --green-deep: #128a49;
    --on-green: #ffffff;
    --gold: #a8741c;
    --coral: #d93f3f;
    --glow: rgba(23, 168, 90, 0.14);
    --star: rgba(168, 116, 28, 0.08);
    color-scheme: light;
  }
}

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

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

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

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

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }

.ar { font-family: var(--arabic); direction: rtl; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 36em; }
.muted { color: var(--muted); }

/* Faint eight-point stars behind everything, like tilework. */
.pattern {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23e6c280' stroke-width='1' opacity='0.5'%3E%3Crect x='40' y='40' width='40' height='40'/%3E%3Crect x='40' y='40' width='40' height='40' transform='rotate(45 60 60)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px;
  opacity: 0.09;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.brand img { width: 26px; height: auto; }
.brand img.brand-logo { width: auto; height: 54px; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 640px) { .nav .hide-sm { display: none; } .nav { gap: 16px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--green); color: var(--on-green); box-shadow: 0 10px 30px -10px var(--glow); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--muted); }
.btn[aria-disabled="true"] { opacity: .75; cursor: default; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Sections ---------- */
section { padding: clamp(72px, 11vw, 128px) 0; }
.section-head { display: grid; gap: 16px; max-width: 760px; margin-bottom: 52px; }
.center { text-align: center; margin-inline: auto; justify-items: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green);
  margin-bottom: 18px;
}
.icon svg { width: 22px; height: 22px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.98rem; }

/* Arch-shaped panel (a mihrab outline). */
.arch {
  position: relative;
  border-radius: 999px 999px var(--radius) var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
}

/* ---------- Quote ---------- */
.quote { display: grid; gap: 18px; justify-items: center; text-align: center; max-width: 820px; margin-inline: auto; }
.quote .ar { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.9; color: var(--text); }
.quote p.tr { font-size: 1.2rem; color: var(--muted); font-style: italic; }
.quote cite { font-style: normal; font-size: 0.9rem; color: var(--gold); letter-spacing: 0.04em; }

/* ---------- Does / never ---------- */
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.facts li { display: grid; grid-template-columns: 26px 1fr; gap: 14px; align-items: start; color: var(--muted); }
.facts .mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; font-weight: 800; margin-top: 1px; }
.facts .yes .mark { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.facts .no .mark { background: color-mix(in srgb, var(--coral) 16%, transparent); color: var(--coral); }
.facts strong { color: var(--text); font-weight: 600; }

/* ---------- Support ---------- */
.support {
  position: relative; overflow: hidden;
  border-radius: 32px; padding: clamp(36px, 6vw, 72px);
  background:
    radial-gradient(600px 300px at 100% 0%, var(--glow), transparent 70%),
    linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  display: grid; gap: 22px; justify-items: start;
}
.support .ar { font-size: 1.8rem; color: var(--gold); line-height: 1.6; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 48px 0 56px; color: var(--soft); font-size: 0.92rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-foot a { text-decoration: none; color: var(--muted); }
.site-foot a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Long-form text (privacy policy) ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; margin: 48px 0 14px; }
.prose p, .prose li { color: var(--muted); }
.prose p + p { margin-top: 14px; }
.prose ul { padding-left: 22px; display: grid; gap: 8px; }
.prose strong { color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--text); font-weight: 600; }
.prose td { color: var(--muted); }
.table-scroll { overflow-x: auto; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
