/* Self-hosted fonts (latin subsets) — replaces Google Fonts CDN */
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/fraunces-italic-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/fraunces-normal-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/fraunces-normal-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-normal-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-normal-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/work-sans-normal-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/work-sans-normal-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/work-sans-normal-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/work-sans-normal-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =========================================================
   QURANIA — Design System
   Palette:  emerald #1D6A4F · antique gold #C6A24B
             ivory #FAF7EC · ink #12332A · sage #E8EDE7
   Display:  Fraunces (warm literary serif, echoes the wordmark)
   Body:     Work Sans
   Utility:  JetBrains Mono (small caps labels, attribution)
   Signature: the "crossed rehal" divider — a thin line motif
              pulled directly from the Qurania mark, used to
              break sections instead of a generic rule or icon.
   ========================================================= */

:root {
  --emerald: #1D6A4F;
  --emerald-dark: #12332A;
  --gold: #C6A24B;
  --gold-deep: #7F6220;
  --gold-soft: #DCC079;
  --ivory: #FAF7EC;
  --ivory-warm: #F4EFE1;
  --sage: #E8EDE7;
  --ink: #1C2620;
  --ink-soft: #4A564E;
  --white: #FFFFFF;
  --shadow: 0 12px 32px -12px rgba(18, 51, 42, 0.18);
  --radius: 4px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Work Sans', sans-serif;
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--emerald-dark);
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.35rem; }

em, .accent-italic {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--gold-deep);
}

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--emerald); text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 500;
  display: block;
  margin-bottom: 0.9em;
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.section { padding: 88px 0; }
.section-tight { padding: 56px 0; }
.section-sage { background: var(--sage); }
.section-ink { background: var(--emerald-dark); color: var(--ivory-warm); }
.section-ink h2, .section-ink h3 { color: var(--ivory); }
.section-ink p { color: #B9C7BE; }

/* ---------- Header ---------- */
header.site {
  position: sticky; top: 0; z-index: 100;
  background: #FAF7EC;
  border-bottom: 1px solid rgba(18,51,42,0.08);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; max-width: var(--max); margin: 0 auto;
}
.nav img.logo { height: 60px; width: auto; }
@media (max-width: 480px) { .nav img.logo { height: 46px; } }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a {
  color: var(--emerald-dark); font-weight: 500; font-size: 0.95rem;
}
.nav-cta {
  background: var(--emerald); color: var(--white) !important;
  padding: 10px 22px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none !important;
}
.nav-cta:hover { background: var(--emerald-dark); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-links {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 500;
    background: #FAF7EC;
    opacity: 0;
    visibility: hidden;
    flex-direction: column; align-items: flex-start;
    justify-content: flex-start;
    padding: 100px 28px 30px; gap: 22px;
    transform: translateX(100%);
    transition: transform .3s ease, opacity .3s ease, visibility .3s;
  }
  .nav-links.open { transform: translateX(0); opacity: 1; visibility: visible; }
  .nav-toggle { display: block; background: none; border: none; font-size: 1.6rem; color: var(--emerald-dark); position: relative; z-index: 501; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 14px 30px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.98rem; text-decoration: none !important;
  transition: all .18s ease; border: 1.5px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--emerald); color: var(--white) !important; }
.btn-primary:hover { background: var(--emerald-dark); transform: translateY(-1px); }
.btn-ghost { border-color: var(--emerald); color: var(--emerald) !important; }
.btn-ghost:hover { background: var(--emerald); color: var(--white) !important; }
.btn-gold { background: var(--gold); color: var(--emerald-dark) !important; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 900px); justify-content: center;
  gap: 48px; padding: 92px 28px 76px; max-width: var(--max); margin: 0 auto;
  text-align: center;
}
.hero img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-copy p.lede { font-size: 1.18rem; max-width: 54ch; margin-left: auto; margin-right: auto; }
.proof-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; margin: 30px 0 34px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--emerald-dark);
}
.proof-strip span::before { content: "— "; color: var(--gold); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

/* ---------- Rehal divider (signature element) ---------- */
.rehal-divider {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 6px 0 40px; opacity: 0.85;
}
.rehal-divider svg { width: 54px; height: 30px; }
.rehal-divider::before, .rehal-divider::after {
  content: ""; height: 1px; width: 90px; background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------- Cards / grids ---------- */
/* auto-fit means these reflow 3 -> 2 -> 1 at whatever width the content needs,
   rather than snapping at one hardcoded breakpoint. Tablets get 2 columns
   instead of falling all the way to a single column. */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 40px; align-items: center; }

.card {
  background: var(--white); border: 1px solid rgba(18,51,42,0.08);
  border-radius: var(--radius); padding: 32px; box-shadow: 0 4px 18px -10px rgba(18,51,42,0.1);
}
.card .num { font-family: 'Fraunces', serif; font-style: italic; color: var(--gold-deep); font-size: 1.6rem; }

/* ---------- Story arc section ---------- */
.story-row {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 46px; align-items: center;
  padding: 50px 0; border-bottom: 1px solid rgba(18,51,42,0.08);
}
.story-row:nth-child(even) { direction: rtl; }
.story-row:nth-child(even) > * { direction: ltr; }
.story-row img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.story-row .story-tag { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold-deep); }
@media (max-width: 860px) {
  .story-row, .story-row:nth-child(even) { grid-template-columns: 1fr; direction: ltr; }
}

/* ---------- Testimonials ---------- */
.testimonial {
  background: var(--white); border-left: 3px solid var(--gold);
  padding: 26px 30px; border-radius: var(--radius); margin-bottom: 20px;
}
.testimonial p.quote { font-family: 'Fraunces', serif; font-style: italic; font-size: 1.12rem; color: var(--emerald-dark); }
.testimonial .attribution { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--ink-soft); }
.placeholder-flag {
  display: inline-block; margin-top: 6px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem; color: var(--gold-deep); border: 1px dashed var(--gold); padding: 2px 8px; border-radius: 3px;
}

/* ---------- FAQ ---------- */
details.faq { border-bottom: 1px solid rgba(18,51,42,0.1); padding: 18px 0; }
details.faq summary { cursor: pointer; font-weight: 600; color: var(--emerald-dark); font-size: 1.05rem; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; float: right; color: var(--gold); font-size: 1.3rem; }
details.faq[open] summary::after { content: "–"; }
details.faq .faq-answer { margin-top: 12px; max-width: 68ch; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; padding: 80px 28px; }
.cta-band h2 { max-width: 22ch; margin-left: auto; margin-right: auto; }

/* ---------- Footer ---------- */
footer.site {
  background: var(--emerald-dark); color: #B9C7BE; padding: 60px 0 30px;
}
footer.site .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; }
footer.site h4 { color: var(--ivory); font-family: 'Work Sans', sans-serif; font-size: 0.95rem; margin-bottom: 14px; }
footer.site a { color: #B9C7BE; display: block; margin-bottom: 8px; font-size: 0.92rem; }
footer.site .tagline { font-family: 'Fraunces', serif; font-style: italic; color: var(--gold); }
.footer-bottom {
  max-width: var(--max); margin: 40px auto 0; padding: 20px 28px 0; border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
@media (max-width: 860px) { footer.site .container { grid-template-columns: 1fr 1fr; } }

/* ---------- Blog ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.blog-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 18px -10px rgba(18,51,42,0.12); }
.blog-card .b-body { padding: 22px; }
.blog-card .b-cluster { font-family:'JetBrains Mono',monospace; font-size:0.68rem; color:var(--gold-deep); text-transform:uppercase; letter-spacing:.08em; }
@media (max-width: 860px) { .blog-grid { grid-template-columns: 1fr; } }

article.post { max-width: 74ch; margin: 0 auto; }
article.post h2 { margin-top: 1.4em; }
.answer-box {
  background: var(--sage); border-left: 3px solid var(--emerald);
  padding: 18px 22px; border-radius: var(--radius); margin: 1.2em 0; font-size: 0.98rem;
}
.answer-box .label { font-family:'JetBrains Mono',monospace; font-size:0.7rem; text-transform:uppercase; color: var(--emerald); letter-spacing:.08em; display:block; margin-bottom:6px;}

.breadcrumb { font-family:'JetBrains Mono',monospace; font-size:0.78rem; color: var(--ink-soft); margin-bottom: 20px; }
.breadcrumb a { color: var(--emerald); }

/* ---------- Accessibility ---------- */

/* Keyboard users can jump the nav; visually hidden until focused. */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--emerald-dark); color: var(--ivory) !important;
  padding: 12px 20px; border-radius: 0 0 var(--radius) 0;
  font-size: 0.92rem; font-weight: 600; text-decoration: none !important;
}
.skip-link:focus { left: 0; }

/* A visible focus ring on every interactive element. Uses :focus-visible so
   the ring appears for keyboard navigation without outlining mouse clicks. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* On the dark section an emerald button sits at roughly 2:1 against its
   backdrop, under the 3:1 WCAG 1.4.11 floor for non-text contrast. Gold on
   emerald-dark clears it comfortably and keeps the button legible as a shape. */
.section-ink .btn-primary {
  background: var(--gold);
  color: var(--emerald-dark) !important;
}
.section-ink .btn-primary:hover { background: var(--gold-soft); }

/* Respect users who have asked their OS to reduce motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Voice sample ---------- */
.voice-player { margin-top: 26px; display: flex; justify-content: center; }
.voice-player audio { border-radius: var(--radius); }
/* Hidden until assets/audio/qari-sample.mp3 exists; main.js removes the section
   if the file is missing so visitors never meet a dead player. */
#voice[hidden] { display: none; }

/* =========================================================
   RESPONSIVE LAYER
   Roughly 60-70% of visitors are on phones, so these are not
   afterthought overrides -- mobile is the primary target.
   Tiers: phone (<=640) · large phone/tablet (641-980) · desktop
   ========================================================= */

/* Nothing may push the page sideways on a narrow screen.
   `clip` rather than `hidden`: hidden on html/body creates a scroll container
   and silently breaks the sticky header. clip contains overflow without that. */
body { overflow-x: clip; }
img, video, audio, iframe { max-width: 100%; height: auto; }
body { overflow-wrap: break-word; }

/* ---- Tablet ---- */
@media (max-width: 980px) {
  .section { padding: 68px 0; }
  .hero { padding: 68px 24px 56px; }
  .story-row { gap: 34px; padding: 40px 0; }
}

/* ---- Phone ---- */
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .section { padding: 48px 0; }
  .section-tight { padding: 36px 0; }

  .hero { padding: 44px 20px 40px; }
  .hero-copy p.lede { font-size: 1.06rem; }

  /* The display face is set for wide measures; ease it down so the
     headline does not eat the entire first screen on a phone. */
  h1 { font-size: clamp(2rem, 8vw, 2.6rem); }
  h2 { font-size: clamp(1.5rem, 6vw, 2rem); }

  .proof-strip { gap: 8px 18px; font-size: 0.75rem; margin: 22px 0 26px; }

  .story-row { gap: 24px; padding: 32px 0; }
  .card { padding: 24px; }
  .answer-box { padding: 18px 20px; }

  /* Full-width tap target rather than a small button to aim at. */
  .btn { display: block; width: 100%; text-align: center; padding: 15px 24px; }
  .cta-band { padding: 56px 20px; }

  footer.site .container { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}

/* ---- Touch targets ----
   The mobile nav overlay stacked links at roughly 24px tall; WCAG 2.5.5 and
   both platform guidelines want ~44px minimum for anything a finger hits. */
@media (max-width: 860px) {
  .nav-links a {
    display: flex; align-items: center;
    min-height: 44px; font-size: 1.05rem; width: 100%;
  }
  .nav-toggle { min-width: 44px; min-height: 44px; }
  footer.site a { min-height: 32px; display: flex; align-items: center; }
}

/* ---------- Hadiya pricing ---------- */
.currency-toggle {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin: 0 auto 34px; max-width: 340px;
  background: var(--white); border: 1px solid rgba(18,51,42,0.12);
  border-radius: 999px; padding: 5px;
}
.currency-toggle button {
  flex: 1; min-width: 64px; min-height: 40px; cursor: pointer;
  border: none; background: transparent; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; letter-spacing: 0.04em;
  color: var(--ink-soft); transition: background .15s ease, color .15s ease;
}
.currency-toggle button.active { background: var(--emerald); color: var(--white); }

.price-card { position: relative; display: flex; flex-direction: column; }
.price-card .tier-note { font-family: 'Work Sans', sans-serif; font-weight: 400; color: var(--ink-soft); font-size: 0.95rem; }
.price-card .freq { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--gold-deep); margin: 2px 0 16px; }
.price-card .price { margin: 0 0 6px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-card .was {
  font-family: 'Fraunces', serif; font-size: 1.15rem; color: var(--ink-soft);
  text-decoration: line-through; text-decoration-color: rgba(198,162,75,0.7);
}
.price-card .now { font-family: 'Fraunces', serif; font-size: 2.1rem; color: var(--emerald-dark); line-height: 1; }
.price-card .per { font-size: 0.9rem; color: var(--ink-soft); }
.price-card .founding-note { font-size: 0.78rem; color: var(--gold-deep); margin: 0 0 16px; font-weight: 500; }
.price-card .feat { color: var(--ink-soft); font-size: 0.95rem; margin: auto 0 0; }

.price-card.tier-anchor { border-color: var(--gold); box-shadow: 0 8px 30px -14px rgba(198,162,75,0.55); }
.tier-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: var(--emerald-dark);
  font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 5px 14px; border-radius: 999px; white-space: nowrap;
}
.price-footnote { max-width: 70ch; margin: 30px auto 0; text-align: center; font-size: 0.92rem; }

/* ---------- Homepage video slots ---------- */
.video-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px; margin-top: 36px;
}
.video-card { margin: 0; }
.video-card video {
  width: 100%; aspect-ratio: 9 / 16; max-height: 520px;
  background: #0d241d; border-radius: var(--radius);
  box-shadow: 0 12px 32px -14px rgba(0,0,0,0.5); display: block;
}
.video-card figcaption {
  margin-top: 14px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; letter-spacing: 0.03em; color: #B9C7BE;
}
#videos[hidden] { display: none; }

/* ---------- Forms ---------- */
form label { display: block; font-size: 0.92rem; font-weight: 500; color: var(--emerald-dark); }
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 11px 12px;
  border: 1px solid rgba(18,51,42,0.25);
  border-radius: var(--radius);
  background: var(--white);
  /* iOS Safari zooms the viewport when a focused field renders below 16px. */
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
}
select { cursor: pointer; }
