@import url('https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600&family=Scheherazade+New:wght@500;700&display=swap');

/* ---------- Theme tokens: light by default, dark from the system or the toggle ---------- */
:root {
  --bg: #f2efe4;
  --surface: #fbf9f2;
  --ink: #12382c;
  --ink-soft: #4a6359;
  --hairline: #dad3be;
  --hairline-strong: #c9c1a8;
  --gold: #7a5a1c;
  --bead: #d6d0bb;
  --bead-on: #1b4d3c;
  --band: #12382c;
  --band-ink: #f2eedf;
  --band-gold: #d2ae62;
  --band-soft: #b7ae8e;
  --danger: #8e3d49;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d241c;
    --surface: #133328;
    --ink: #f2eedf;
    --ink-soft: #b7ae8e;
    --hairline: #24443a;
    --hairline-strong: #36574b;
    --gold: #d2ae62;
    --bead: #2b4a3f;
    --bead-on: #d2ae62;
    --band: #f2eedf;
    --band-ink: #12382c;
    --band-gold: #7a5a1c;
    --band-soft: #4a6359;
    --danger: #e08a96;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d241c;
  --surface: #133328;
  --ink: #f2eedf;
  --ink-soft: #b7ae8e;
  --hairline: #24443a;
  --hairline-strong: #36574b;
  --gold: #d2ae62;
  --bead: #2b4a3f;
  --bead-on: #d2ae62;
  --band: #f2eedf;
  --band-ink: #12382c;
  --band-gold: #7a5a1c;
  --band-soft: #4a6359;
  --danger: #e08a96;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}
a { color: inherit; }
img { max-width: 100%; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gold);
}
h1, h2, h3 { font-weight: 300; letter-spacing: -0.5px; line-height: 1.1; }

/* ---------- Header ---------- */
header.site { border-bottom: 1px solid var(--hairline); }
header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 500;
}
.brand img { width: 40px; height: 40px; border-radius: 10px; }
nav.site { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-left: auto; font-size: 15px; }
nav.site a { text-decoration: none; color: var(--ink-soft); padding: 8px 0; }
nav.site a:hover { color: var(--ink); }
nav.site a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--hairline); }
footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 14px;
  color: var(--ink-soft);
}
footer.site a { color: var(--ink-soft); }
footer.site .contact { margin-left: auto; }

/* ---------- Landing: bands ---------- */
.band { border-bottom: 1px solid var(--hairline); }
.band.alt { background: var(--surface); }
.section { padding-top: 88px; padding-bottom: 88px; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 40px; }
.section-head h2 { margin: 0; font-size: 42px; }

/* Hero */
.hero-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 56px;
  padding-top: 72px;
  padding-bottom: 88px;
}
.hero-copy { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero-copy h1 { margin: 0; font-size: clamp(44px, 6vw, 76px); line-height: 1.02; letter-spacing: -1.2px; }
.hero-copy .lede { margin: 0; max-width: 520px; font-size: 19px; line-height: 1.55; color: var(--ink-soft); }
.promise-line { font-size: 14px; color: var(--ink-soft); }
.hero-art { flex: 1 1 420px; min-width: 0; display: flex; justify-content: center; }
.ring { position: relative; width: 460px; max-width: 100%; aspect-ratio: 1 / 1; }
.ring svg.beads { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring .phone { position: absolute; left: 30%; top: 12%; width: 40%; height: 76%; border-width: 6px; }

/* Store buttons */
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.store-btn {
  min-height: 56px;
  padding: 0 22px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  font-family: inherit;
}
.store-btn.is-soon {
  background: transparent;
  color: var(--ink-soft);
  border: 1px dashed var(--hairline-strong);
  cursor: default;
}
.store-btn .label { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-btn .eyebrow { font-size: 11px; letter-spacing: 0.3px; }
.store-btn .name { font-size: 18px; font-weight: 500; }
.stores.centered { justify-content: center; }

/* Phone placeholders (replaced with screenshots later) */
.phone {
  border: 8px solid var(--ink);
  border-radius: 36px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 28px; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.step { display: flex; flex-direction: column; gap: 10px; padding-top: 22px; border-top: 1px solid var(--hairline-strong); }
.step .n { font-size: 40px; font-weight: 300; color: var(--gold); line-height: 1; }
.step h3 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: 0; }
.step p { margin: 0; font-size: 16px; color: var(--ink-soft); }

/* Features */
.feature {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 72px;
  padding: 56px 0;
  border-bottom: 1px solid var(--hairline);
}
.feature:last-child { border-bottom: none; }
.feature.flip { flex-direction: row-reverse; }
.feature-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.feature-copy h3 { margin: 0; font-size: 36px; }
.feature-copy p { margin: 0; max-width: 480px; color: var(--ink-soft); }
.feature-art { flex: 1 1 360px; min-width: 0; display: flex; justify-content: center; }
.feature-art .phone { width: 260px; height: 540px; max-width: 100%; }

/* Ayah band */
.ayah { background: var(--band); color: var(--band-ink); }
.ayah .wrap {
  padding-top: 96px;
  padding-bottom: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.ayah .arabic { font-family: 'Scheherazade New', serif; font-size: clamp(40px, 5vw, 64px); line-height: 1.5; color: var(--band-gold); }
.ayah .meaning { font-size: 22px; font-weight: 300; }
.ayah .ref { font-size: 14px; letter-spacing: 0.4px; color: var(--band-soft); }

/* Promises */
.promises { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; padding-top: 72px; padding-bottom: 72px; }
.promise { display: flex; flex-direction: column; gap: 10px; }
.promise svg { color: var(--gold); }
.promise h3 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: 0; }
.promise p { margin: 0; font-size: 15px; color: var(--ink-soft); }

/* FAQ */
.faq { max-width: 900px; margin: 0 auto; }
.faq h2 { margin: 0 0 28px; font-size: 42px; }
.faq details { border-top: 1px solid var(--hairline-strong); padding: 20px 0; }
.faq summary { cursor: pointer; list-style: none; font-size: 19px; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--gold); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 12px 0 0; color: var(--ink-soft); }

/* Final call to action */
.cta .wrap { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.cta img { width: 88px; height: 88px; border-radius: 22px; }
.cta h2 { margin: 0; font-size: 44px; }
.cta p { margin: 0; font-size: 18px; color: var(--ink-soft); }

/* ---------- Inner pages (About, Privacy, Terms, Delete account) ---------- */
main.page { max-width: 760px; margin: 0 auto; padding: 64px 32px 88px; }
.hero { margin-bottom: 40px; }
.hero h1 { margin: 10px 0 14px; font-size: clamp(36px, 5vw, 52px); }
.lede { max-width: 50ch; color: var(--ink-soft); font-size: 18px; margin: 0; }
.updated { font-size: 14px; color: var(--ink-soft); margin: 14px 0 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 28px;
  margin: 0 0 28px;
}
.card:last-of-type { margin-bottom: 0; }
.card h2 { margin: 0 0 12px; font-size: 26px; font-weight: 400; }
p, li { color: var(--ink); }
ul, ol { padding-left: 22px; margin: 0 0 14px; }
li { margin-bottom: 8px; }
.dedication { border-color: var(--gold); }
.dedication .kicker { margin-bottom: 8px; }
.dua { text-align: center; margin: 24px 0; padding: 24px 16px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.dua-arabic { font-family: 'Scheherazade New', serif; font-size: 34px; font-weight: 700; direction: rtl; margin: 0 0 10px; line-height: 1.8; }
.dua-translit { font-style: italic; color: var(--ink-soft); font-size: 14px; margin: 0 0 6px; }
.dua-meaning { color: var(--ink-soft); font-size: 14px; margin: 0; }
.legal-links { display: grid; gap: 10px; margin-top: 16px; }
.legal-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  background: var(--bg);
}
.legal-links a:hover { border-color: var(--gold); }
.legal-links a::after { content: "→"; color: var(--gold); }

/* Account deletion request form */
.request-form { display: grid; gap: 8px; margin: 14px 0 18px; }
.request-form label { font-weight: 500; }
.request-form .optional { font-weight: 400; color: var(--ink-soft); }
.request-form input[type="email"],
.request-form textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.request-form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.request-form .check input { margin-top: 6px; }
.request-form button {
  justify-self: start;
  min-height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: 22px;
  background: var(--danger);
  color: var(--surface);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.request-form button:disabled { opacity: 0.6; cursor: default; }
.form-status { margin: 4px 0 0; min-height: 1.4em; color: var(--ink-soft); }
.form-status.error { color: var(--danger); }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .wrap, main.page { padding-left: 16px; padding-right: 16px; }
  nav.site { margin-left: 0; order: 3; width: 100%; }
  .theme-toggle { margin-left: auto; }
  .section, .hero-grid { padding-top: 56px; padding-bottom: 56px; }
  .section-head h2, .faq h2, .cta h2 { font-size: 34px; }
  .feature-copy h3 { font-size: 30px; }
  .card { padding: 22px; }
  footer.site .contact { margin-left: 0; }
}

/* Bead ring colours (drawn by site.js) */
svg.beads .bead { fill: var(--bead); }
svg.beads .bead.on { fill: var(--bead-on); }
svg.beads .bead.marker { fill: none; stroke: var(--gold); stroke-width: 0.5; }

/* ---------- Motion (calm; switched off for Reduce motion) ---------- */
svg.beads .bead { transition: fill 0.35s ease; }
svg.beads.spin { animation: ring-turn 140s linear infinite; transform-origin: 50% 50%; }
@keyframes ring-turn { to { transform: rotate(360deg); } }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
.ayah .arabic .word { display: inline-block; opacity: 0; transform: translateY(8px); transition: opacity 0.9s ease, transform 0.9s ease; }
.ayah .arabic.in .word { opacity: 1; transform: none; }

.store-btn { transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; }
a.store-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -10px var(--ink); }
.faq summary { transition: color 0.2s ease; }
.faq summary:hover { color: var(--gold); }
.theme-toggle { transition: border-color 0.2s ease; }
.theme-toggle:hover { border-color: var(--gold); }
.phone { transition: transform 0.4s ease; }
.feature:hover .phone { transform: translateY(-4px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .ayah .arabic .word { opacity: 1 !important; transform: none !important; }
}

/* ---------- Scroll-linked motion ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  transition: box-shadow 0.25s ease, background 0.2s ease;
}
header.site.scrolled { box-shadow: 0 6px 24px -14px rgba(0, 0, 0, 0.45); }
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 12px;
  padding: 0 max(16px, calc((100% - 1216px) / 2));
  pointer-events: none;
}
.scroll-progress::before {
  content: "";
  position: absolute;
  left: max(16px, calc((100% - 1216px) / 2));
  right: max(16px, calc((100% - 1216px) / 2));
  top: 50%;
  border-top: 1px solid var(--hairline-strong);
}
.pbead {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bead);
  transition: background 0.25s ease, transform 0.25s ease;
}
.pbead.on { background: var(--gold); transform: scale(1.25); }
.reveal.from-left { transform: translateX(-48px); }
.reveal.from-right { transform: translateX(48px); }
.reveal.from-left.in, .reveal.from-right.in { transform: none; }
.ring, .feature .phone, .ayah .wrap { will-change: translate, scale; }
@media (prefers-reduced-motion: reduce) {
  .reveal.from-left, .reveal.from-right { transform: none !important; }
}
section[id] { scroll-margin-top: 80px; }

/* Contact form and home "Get in touch" band */
.request-form select {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.request-form input[type="text"] {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.request-form button.primary { background: var(--ink); color: var(--bg); }
.contact-band { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.contact-band .section-head { margin-bottom: 0; }
.contact-band p { margin: 0; max-width: 560px; color: var(--ink-soft); font-size: 18px; }
.button-primary {
  min-height: 52px;
  padding: 0 24px;
  border-radius: 26px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  transition: transform 0.2s ease;
}
.button-primary:hover { transform: translateY(-2px); }

/* Honeypot: hidden from people, filled in by bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Screenshots inside the phone frames: light or dark to match the site */
.phone.has-shot { padding: 0; overflow: hidden; }
.phone.has-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 0; }
.phone .shot-dark { display: none !important; }
:root[data-theme="dark"] .phone .shot-light { display: none !important; }
:root[data-theme="dark"] .phone .shot-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .phone .shot-light { display: none !important; }
  :root:not([data-theme="light"]) .phone .shot-dark { display: block !important; }
}
