/* Rahmah Counselling — main stylesheet. Tokens and rules: see DESIGN.md */

:root {
  --sage: #99B4AA;
  --sage-100: #E4ECE8;
  --olive: #6B6D43;
  --olive-800: #55572F;
  --khaki: #ABA66F;
  --clay: #CF7D65;
  --clay-700: #A9573F;
  --blush: #E1B8A2;
  --cream: #F0DFC7;
  --paper: #FBF7F1;
  --ink: #2F3A33;
  --ink-soft: #56625A;

  --f-head: "Tenor Sans", "Gill Sans", "Segoe UI", sans-serif;
  --f-body: "Mulish", "Segoe UI", system-ui, sans-serif;
  --f-arabic: "Amiri", "Traditional Arabic", serif;

  --max: 1180px;
  --gutter: 20px;
  --section: 80px;
  --radius: 4px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}
@media (min-width: 640px) { :root { --gutter: 32px; --section: 104px; } }
@media (min-width: 1200px) { :root { --section: 136px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.7 var(--f-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
@media (min-width: 960px) { body { font-size: 18px; } }
img { max-width: 100%; display: block; }
a { color: var(--clay-700); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--olive); }
:focus-visible { outline: 2px solid var(--clay-700); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--f-head); font-weight: 400; line-height: 1.2; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4.1rem); line-height: 1.1; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.55rem); }
h1 em, h2 em { font-style: normal; color: var(--clay-700); }
p { margin: 0 0 1.1em; max-width: 62ch; }
.lead { font-size: 1.15em; font-weight: 300; color: var(--ink-soft); }
.eyebrow {
  display: inline-block; font: 600 .78rem/1.4 var(--f-body);
  letter-spacing: .18em; text-transform: uppercase; color: var(--olive); margin-bottom: 1.1rem;
}
.center { text-align: center; }
.center p { margin-left: auto; margin-right: auto; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: var(--radius); text-decoration: none;
}
.skip:focus { top: 12px; color: #fff; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(760px + 2 * var(--gutter)); }
.section { position: relative; padding: var(--section) 0; }
.tint-sage { background: var(--sage-100); }
.tint-sage .steps li::before { background: var(--sage-100); }

/* ---------- Atmosphere: soft washes + paper grain ---------- */
.washes { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.washes span {
  position: absolute; border-radius: 50%; opacity: .55; will-change: transform;
  animation: drift 46s ease-in-out infinite alternate;
}
.washes span:nth-child(1) { width: 52vw; height: 52vw; left: -14vw; top: 8vh; background: radial-gradient(closest-side, var(--sage), transparent); }
.washes span:nth-child(2) { width: 40vw; height: 40vw; right: -10vw; top: 38vh; background: radial-gradient(closest-side, var(--blush), transparent); animation-duration: 58s; animation-delay: -12s; }
.washes span:nth-child(3) { width: 36vw; height: 36vw; left: 30vw; bottom: -18vw; background: radial-gradient(closest-side, var(--cream), transparent); animation-duration: 64s; animation-delay: -30s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4vw, -3vh) scale(1.08); }
  100% { transform: translate(-3vw, 4vh) scale(.95); }
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.18 0 0 0 0 0.2 0 0 0 0 0.18 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Top bar + header ---------- */
.topbar {
  background: var(--sage-100); text-align: center; padding: 6px var(--gutter);
  font: 400 1.05rem/1.6 var(--f-arabic); color: var(--olive);
}
.topbar small { font: 400 .72rem/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-left: .8em; }
@media (max-width: 479px) { .topbar small { display: none; } }

.header { position: relative; z-index: 20; background: rgba(251, 247, 241, .92); backdrop-filter: blur(8px); }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 36px; height: 36px; }
.brand span { font: 400 1.2rem/1.1 var(--f-head); letter-spacing: .04em; }
.brand span small { display: block; font: 600 .62rem/1.4 var(--f-body); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-soft); }

.header .wrap { flex-wrap: wrap; }
.nav-toggle {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px;
  background: none; border: 1px solid var(--khaki); border-radius: var(--radius); color: var(--ink); cursor: pointer;
}
.js .nav-toggle { display: inline-flex; }
.nav-toggle svg { width: 20px; height: 20px; }
.nav { width: 100%; padding: 0 0 16px; }
.js .nav {
  position: absolute; left: 0; right: 0; top: 100%; background: var(--paper);
  border-top: 1px solid rgba(171, 166, 111, .35); box-shadow: 0 18px 30px -18px rgba(47, 58, 51, .25);
  padding: 8px var(--gutter) 24px; display: none;
}
.js .nav.open { display: block; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a:not(.btn) { display: block; padding: 12px 0; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.nav a[aria-current="page"] { color: var(--clay-700); }
.nav .btn { margin-top: 12px; }
@media (min-width: 960px) {
  .header .wrap { flex-wrap: nowrap; }
  .js .nav-toggle { display: none; }
  .nav, .js .nav { position: static; display: flex; width: auto; align-items: center; gap: 32px; padding: 0; border: 0; box-shadow: none; background: none; }
  .nav ul { display: flex; gap: 30px; }
  .nav a:not(.btn) { padding: 6px 0; font-size: .95rem; position: relative; }
  .nav ul a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--clay);
    transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
  }
  .nav ul a:hover::after, .nav ul a[aria-current="page"]::after { transform: scaleX(1); }
  .nav .btn { margin: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px;
  padding: 12px 26px; border-radius: var(--radius); border: 1px solid var(--olive);
  background: var(--olive); color: #fff; font: 600 .95rem/1.2 var(--f-body); letter-spacing: .03em;
  text-decoration: none; cursor: pointer; transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn:hover { background: var(--olive-800); border-color: var(--olive-800); color: #fff; }
.btn.ghost { background: transparent; color: var(--olive); }
.btn.ghost:hover { background: var(--olive); color: #fff; }
.btn.light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .75); }
.btn.light:hover { background: #fff; color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.center .btn-row, .cta .btn-row { justify-content: center; }

/* ---------- Hero (home) ---------- */
.hero { position: relative; color: #fff; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; animation: slowzoom 28s ease-out both; }
@keyframes slowzoom { from { transform: scale(1.1); } to { transform: scale(1); } }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(36, 46, 40, .55) 0%, rgba(36, 46, 40, .32) 45%, rgba(36, 46, 40, .5) 100%);
}
.hero-inner { padding-top: clamp(80px, 12vw, 150px); padding-bottom: clamp(150px, 16vw, 210px); }
.hero h1 { max-width: 15ch; }
.hero h1 em { color: var(--blush); }
.hero .lead { color: rgba(255, 255, 255, .92); max-width: 44ch; }
.hero .eyebrow { color: var(--cream); }

.service-tiles {
  margin-top: clamp(48px, 7vw, 80px); display: grid; gap: 1px; background: rgba(255, 255, 255, .28);
  border: 1px solid rgba(255, 255, 255, .28); border-radius: var(--radius); overflow: hidden;
  backdrop-filter: blur(6px);
}
@media (min-width: 640px) { .service-tiles { grid-template-columns: repeat(3, 1fr); } }
.service-tiles a {
  display: flex; align-items: center; gap: 14px; padding: 22px 24px; color: #fff; text-decoration: none;
  background: rgba(47, 58, 51, .32); font: 400 1.2rem/1.2 var(--f-head); transition: background .35s var(--ease);
}
.service-tiles a:hover { background: rgba(47, 58, 51, .55); color: #fff; }
.service-tiles img { width: 24px; height: 24px; filter: brightness(0) invert(1); opacity: .9; }
.service-tiles .arrow { margin-left: auto; transition: transform .35s var(--ease); }
.service-tiles a:hover .arrow { transform: translateX(4px); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; overflow: hidden; isolation: isolate; color: #fff; }
.page-hero .hero-bg img { animation-duration: 22s; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(36, 46, 40, .58), rgba(36, 46, 40, .45));
}
.page-hero .wrap { padding-top: clamp(72px, 10vw, 120px); padding-bottom: clamp(110px, 13vw, 170px); }
.page-hero h1 { max-width: 18ch; }
.page-hero h1 em { color: var(--blush); }
.page-hero .lead { color: rgba(255, 255, 255, .92); }
.page-hero .eyebrow { color: var(--cream); }

/* ---------- Motif ---------- */
.mark-divider { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0 auto 28px; }
.mark-divider::before, .mark-divider::after { content: ""; width: 56px; height: 1px; background: var(--khaki); }
.mark-divider img { width: 26px; height: 26px; }

.marks { list-style: none; padding: 0; margin: 24px 0 0; }
.marks li { position: relative; padding-left: 34px; margin-bottom: 16px; max-width: 56ch; }
.marks li::before { content: ""; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; background: url("../img/logo-mark.svg") no-repeat center / contain; }
.marks strong { font-weight: 600; display: block; color: var(--ink); }

.arabic { font-family: var(--f-arabic); font-size: 1.25em; color: var(--olive); }

/* ---------- Images: one arch per page, painted edges otherwise ---------- */
.arch {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 130' preserveAspectRatio='none'%3E%3Cpath d='M0 130V52C0 24 22 8 50 0C78 8 100 24 100 52V130Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 130' preserveAspectRatio='none'%3E%3Cpath d='M0 130V52C0 24 22 8 50 0C78 8 100 24 100 52V130Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  aspect-ratio: 10 / 13; object-fit: cover; width: 100%;
}
.arch-frame { position: relative; max-width: 440px; margin: 0 auto; }
.photo { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.photo.tall { aspect-ratio: 4 / 5; }

/* ---------- Layout helpers ---------- */
.split { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) {
  .split { grid-template-columns: 1fr 1fr; gap: 88px; }
  .split.flip > :first-child { order: 2; }
  .split.wide-text { grid-template-columns: 5fr 6fr; }
}

.steps { display: grid; gap: 40px; margin-top: 56px; counter-reset: step; }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 56px; } }
.steps li { list-style: none; position: relative; padding-top: 28px; border-top: 1px solid var(--khaki); }
.steps li::before {
  counter-increment: step; content: "0" counter(step); position: absolute; top: -.85em; left: 0;
  background: var(--paper); padding-right: 14px; font: 400 1.1rem/1.6 var(--f-head); color: var(--clay-700);
}
.steps h3 { margin-bottom: .35em; }
.steps p { color: var(--ink-soft); margin: 0; }
ol.steps { padding: 0; }

/* ---------- Textured section (leaf shadow) ---------- */
.verse { text-align: center; }
.verse .arabic { display: block; font-size: clamp(1.7rem, 3.6vw, 2.4rem); line-height: 1.9; color: var(--ink); margin-bottom: 18px; }
.verse blockquote { margin: 0 auto; max-width: 30ch; font: 400 clamp(1.4rem, 2.8vw, 2rem)/1.45 var(--f-head); }
.verse blockquote p { margin: 0; }
h2 .arabic { font-size: 1.15em; }
.values { display: grid; gap: 40px; margin-top: 56px; }
@media (min-width: 640px) { .values { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .values { grid-template-columns: repeat(4, 1fr); } }
.values div { padding-top: 22px; border-top: 1px solid var(--khaki); }
.values img { width: 26px; height: 26px; margin-bottom: 16px; }
.values h3 { margin-bottom: .3em; }
.values p { color: var(--ink-soft); margin: 0; font-size: .97rem; }
.verse cite { display: block; margin-top: 20px; font: 600 .78rem/1.4 var(--f-body); letter-spacing: .18em; text-transform: uppercase; font-style: normal; color: var(--olive); }

/* ---------- Services page ---------- */
.service { scroll-margin-top: 24px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 28px 0 0; padding: 20px 0 0; border-top: 1px solid rgba(171, 166, 111, .4); font-size: .95rem; color: var(--ink-soft); }
.facts div { display: flex; flex-direction: column; }
.facts dt { font: 600 .72rem/1.4 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--olive); }
.facts dd { margin: 2px 0 0; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; background: var(--paper); border-radius: var(--radius); padding: 8px clamp(20px, 4vw, 48px); box-shadow: 0 30px 60px -44px rgba(47, 58, 51, .35); }
.faq details { border-bottom: 1px solid rgba(171, 166, 111, .45); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 24px 0; font: 400 1.18rem/1.35 var(--f-head);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px; border-right: 1.5px solid var(--olive); border-bottom: 1.5px solid var(--olive);
  transform: rotate(45deg) translateY(-3px); transition: transform .35s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq details > div { padding: 0 0 24px; color: var(--ink-soft); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 56px; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 5fr 7fr; gap: 88px; } }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; }
.contact-list li { padding: 16px 0; border-top: 1px solid rgba(171, 166, 111, .45); }
.contact-list span { display: block; font: 600 .72rem/1.4 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--olive); }
.form { display: grid; gap: 22px; }
@media (min-width: 640px) { .form { grid-template-columns: 1fr 1fr; } .form .full { grid-column: 1 / -1; } }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 8px; }
.field label small { font-weight: 400; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: rgba(255, 255, 255, .75);
  border: 1px solid #B9B48A; border-radius: var(--radius); padding: 13px 14px; min-height: 50px;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--olive); background: #fff; box-shadow: 0 0 0 3px rgba(107, 109, 67, .18); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: var(--ink-soft); }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--olive); flex: none; }
.form-note { font-size: .88rem; color: var(--ink-soft); margin: 0; }
.form-status { grid-column: 1 / -1; margin: 0; padding: 14px 16px; border-radius: var(--radius); background: var(--sage-100); color: var(--ink); }
.form-status[hidden] { display: none; }

.notice { border-left: 2px solid var(--clay); padding: 4px 0 4px 18px; color: var(--ink-soft); font-size: .95rem; }

/* ---------- CTA + footer ---------- */
.cta { text-align: center; }
.cta h2 { max-width: 20ch; margin-left: auto; margin-right: auto; }

.footer { position: relative; background: var(--ink); color: rgba(255, 255, 255, .78); padding: clamp(110px, 12vw, 150px) 0 40px; font-size: .95rem; }
.footer { margin-top: 0; }
.footer a { color: rgba(255, 255, 255, .86); text-decoration: none; }
.footer a:hover { color: var(--blush); }
.footer-grid { display: grid; gap: 40px; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer .brand { color: #fff; }
.footer .brand img { filter: brightness(0) invert(1); opacity: .85; }
.footer .brand span small { color: rgba(255, 255, 255, .6); }
.footer h2 { font: 600 .74rem/1.4 var(--f-body); letter-spacing: .18em; text-transform: uppercase; color: var(--khaki); margin-bottom: 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; }
.footer-note { margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .14); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: .85rem; color: rgba(255, 255, 255, .6); }
.footer-note p { margin: 0; max-width: none; }

.verse .sep { display: inline-block; width: .8em; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
