/* ─────────────────────────────────────────────────────────────────────────
   Our Masajid — marketing site
   Shares the product redesign's design language: Geist type, emerald/bone/ink
   palette, hard borders, Islamic geometry as SVG punctuation, dark mode.
   ────────────────────────────────────────────────────────────────────── */

:root {
  /* Color */
  --ink: #0A0A0A;
  --ink-2: #1F1F1F;
  --bone: #FAF9F6;
  --bone-2: #F2F0EA;
  --line: #E5E2DA;
  --line-strong: #C8C5BC;
  --muted: #6B6B6B;
  --emerald: #0E5237;
  --emerald-2: #0A3D29;
  --emerald-soft: #E6EFEA;
  --emerald-tint: #F1F5F2;
  --brass: #B8893D;
  --indigo: #3F4FA0;
  --terracotta: #B25D3B;
  --signal: #16A34A;

  /* Pinned tokens — never flip in dark mode (text on dark/emerald). */
  --bone-pinned: #FAF9F6;
  --ink-pinned: #0A0A0A;
  --emerald-pinned: #0E5237;
  --emerald-2-pinned: #0A3D29;

  /* Type */
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing (4px scale) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* Radii */
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
::selection { background: var(--ink); color: var(--bone); }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.container--narrow { max-width: 760px; }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 249, 246, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 16px;
  text-decoration: none;
  color: var(--ink);
}
.brand svg { width: 22px; height: 22px; color: var(--emerald); flex-shrink: 0; }
.brand-mark { letter-spacing: 0.06em; }

.nav-links {
  display: flex;
  gap: var(--s-6);
  list-style: none;
  align-items: center;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.6;
  transition: opacity 0.15s;
}
.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; }
.nav-links a.active::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 4px;
  background: var(--ink);
  border-radius: 1px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 11px 20px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bone);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }

.btn--primary { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }

.btn--emerald { background: var(--emerald); color: var(--bone-pinned); border-color: var(--emerald); }
.btn--emerald:hover { background: var(--emerald-2); border-color: var(--emerald-2); }

/* For use on the dark hero */
.btn--on-dark {
  background: var(--bone-pinned);
  color: var(--ink-pinned);
  border-color: var(--bone-pinned);
}
.btn--on-dark:hover { background: #fff; border-color: #fff; }
.btn--ghost-on-dark {
  background: transparent;
  color: var(--bone-pinned);
  border-color: rgba(250, 249, 246, 0.3);
}
.btn--ghost-on-dark:hover {
  background: rgba(250, 249, 246, 0.08);
  border-color: rgba(250, 249, 246, 0.55);
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.07), transparent 55%),
    linear-gradient(180deg, var(--emerald-pinned) 0%, var(--emerald-2-pinned) 100%);
  color: var(--bone-pinned);
  border-radius: var(--r-lg);
  padding: var(--s-9) var(--s-7);
  margin: var(--s-7) 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}
.hero-ornament {
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 360px;
  height: 360px;
  opacity: 0.09;
  z-index: 0;
  color: var(--bone-pinned);
  pointer-events: none;
}
.hero-ornament--left {
  right: auto;
  left: -110px;
  top: -110px;
  bottom: auto;
  width: 300px;
  height: 300px;
}
.hero-inner { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(250, 249, 246, 0.7);
  margin-bottom: var(--s-5);
}
.hero h1 {
  font-size: 60px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.0;
  margin: 0 auto var(--s-5);
  max-width: 14ch;
}
.hero h1 em { font-style: normal; color: rgba(250, 249, 246, 0.62); }
.hero-lead {
  font-size: 19px;
  line-height: 1.55;
  color: rgba(250, 249, 246, 0.82);
  max-width: 56ch;
  margin: 0 auto var(--s-7);
}
.hero-cta-row {
  display: flex;
  gap: var(--s-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* Page hero — compact header for interior pages */
.page-hero { padding: var(--s-8) var(--s-7); }
.page-hero h1 { font-size: 44px; margin-bottom: var(--s-4); }
.page-hero .hero-lead { margin-bottom: 0; }

/* ── Section scaffolding ─────────────────────────────────────────────── */
section.block { padding: var(--s-9) 0; }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto var(--s-8); }
.section-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--emerald);
  font-weight: 600;
  margin-bottom: var(--s-3);
}
.section-title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.section-sub {
  font-size: 18px;
  color: var(--muted);
  margin-top: var(--s-4);
}

/* ── Feature grid ────────────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}
.feature {
  --acc: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-6);
  background: var(--bone);
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.feature::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--acc);
  opacity: 0.85;
}
.feature:hover { border-color: var(--acc); transform: translateY(-2px); }
.feature--emerald    { --acc: var(--emerald); }
.feature--brass      { --acc: var(--brass); }
.feature--indigo     { --acc: var(--indigo); }
.feature--terracotta { --acc: var(--terracotta); }

.feature-icon {
  width: 30px;
  height: 30px;
  color: var(--acc);
  margin-bottom: var(--s-4);
  display: block;
}
.feature-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: var(--s-2);
}
.feature-text { font-size: 15px; color: var(--muted); line-height: 1.55; }

/* ── Steps (How to) ──────────────────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-6);
}
.step-col {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bone);
  padding: var(--s-7);
}
.step-col--tinted { background: var(--emerald-tint); }
.step-col h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.step-col h3 svg { width: 22px; height: 22px; color: var(--emerald); flex-shrink: 0; }

.steps { list-style: none; counter-reset: step; }
.steps > li {
  position: relative;
  padding-left: 48px;
  padding-bottom: var(--s-5);
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--emerald);
  background: var(--emerald-soft);
  border: 1px solid #C6DACE;
  border-radius: 50%;
}
/* connecting line between step markers */
.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}
.step-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.step-text { font-size: 15px; color: var(--muted); line-height: 1.55; }

/* ── Prose (Privacy) ─────────────────────────────────────────────────── */
.prose { font-size: 17px; line-height: 1.65; }
.prose h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: var(--s-7) 0 var(--s-4);
}
.prose h2:first-child { margin-top: 0; }
.prose p { margin-bottom: var(--s-4); color: var(--ink-2); }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--emerald); text-decoration: underline; text-underline-offset: 2px; }

/* ── Forms (Contact) ─────────────────────────────────────────────────── */
.field { display: block; margin-bottom: var(--s-5); }
.label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: var(--s-2);
}
.input, .textarea {
  display: block;
  width: 100%;
  padding: 11px 14px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--bone);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}
.input::placeholder, .textarea::placeholder { color: #A0A0A0; }
.textarea { resize: vertical; min-height: 120px; }
.d-none { display: none !important; }

.form-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bone);
  padding: var(--s-7);
}

/* ── CTA band ────────────────────────────────────────────────────────── */
.cta-band {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--emerald-tint);
  padding: var(--s-8) var(--s-7);
  text-align: center;
}
.cta-band h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; }
.cta-band p { font-size: 18px; color: var(--muted); margin: var(--s-3) 0 var(--s-6); }

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  margin-top: var(--s-9);
  padding: var(--s-7) 0;
  font-size: 14px;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.footer-inner strong { color: var(--ink); font-weight: 600; }
.footer-links a {
  text-decoration: none;
  color: var(--ink);
  opacity: 0.7;
  margin-left: var(--s-5);
  transition: opacity 0.15s;
}
.footer-links a:first-child { margin-left: 0; }
.footer-links a:hover { opacity: 1; }

/* ── Theme toggle ────────────────────────────────────────────────────── */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--ink); background: var(--bone-2); }
.theme-toggle svg { width: 16px; height: 16px; display: none; }
.theme-toggle .icon-sun  { display: block; }
.theme-toggle .icon-moon { display: none; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 48px; }
  .section-title { font-size: 32px; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .nav-links { gap: var(--s-4); }
  .nav-links a:not(.is-cta) { display: none; }
  .features { grid-template-columns: 1fr; }
  .hero { padding: var(--s-8) var(--s-5); }
  .hero h1 { font-size: 38px; }
  .hero-lead { font-size: 17px; }
  .section-title { font-size: 28px; }
  .step-col, .form-card { padding: var(--s-5); }
}

/* ─────────────────────────────────────────────────────────────────────────
   Dark theme — auto via OS preference, manual via [data-theme].
   Pinned tokens keep hero/badges light-on-dark. Black logo is inverted.
   ────────────────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ECEAE3; --ink-2: #D4D2CB;
    --bone: #0E100F; --bone-2: #1A1D1B;
    --line: #2A2D2B; --line-strong: #3A3D3B;
    --muted: #9A9A92;
    --emerald: #2A9466; --emerald-2: #1E7F5C;
    --emerald-soft: #1A2A22; --emerald-tint: #141816;
    --brass: #D4A55F; --indigo: #6979D6; --terracotta: #D58060; --signal: #22C55E;
  }
  :root:not([data-theme="light"]) .nav { background: rgba(14, 16, 15, 0.85); }
  :root:not([data-theme="light"]) .steps > li::before { border-color: var(--line); }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

:root[data-theme="dark"] {
  --ink: #ECEAE3; --ink-2: #D4D2CB;
  --bone: #0E100F; --bone-2: #1A1D1B;
  --line: #2A2D2B; --line-strong: #3A3D3B;
  --muted: #9A9A92;
  --emerald: #2A9466; --emerald-2: #1E7F5C;
  --emerald-soft: #1A2A22; --emerald-tint: #141816;
  --brass: #D4A55F; --indigo: #6979D6; --terracotta: #D58060; --signal: #22C55E;
}
:root[data-theme="dark"] .nav { background: rgba(14, 16, 15, 0.85); }
:root[data-theme="dark"] .steps > li::before { border-color: var(--line); }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
