/* ==========================================================================
   Barakah Clicks — design system
   One stylesheet, no build step. Sections:
   1. Tokens  2. Base  3. Layout  4. Header/nav  5. Buttons
   6. Sections  7. Forms  8. Footer  9. Motion  10. Utilities
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --bg: #f5f1ea;          /* off-white, warm */
  --surface: #ece5d9;     /* slightly deeper paper */
  --ink: #1e1c19;         /* dark neutral for text */
  --muted: #57514a;       /* secondary text (7:1 on --bg) */
  --line: #d6ccbd;        /* hairlines */
  --accent: #9e4a2b;      /* muted terracotta (5:1 on --bg) */
  --accent-dark: #823b21;
  --on-accent: #ffffff;
  --on-ink: #f5f1ea;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --max: 76rem;
  --section-y: clamp(4.5rem, 12vw, 9rem);
  --radius: 2px;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, picture { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  font-variation-settings: "opsz" 144;
}

h1 { font-size: clamp(2.6rem, 9vw, 5.75rem); letter-spacing: -0.025em; line-height: 1.02; }
h2 { font-size: clamp(2rem, 5.5vw, 3.5rem); }
h3 { font-size: clamp(1.4rem, 3vw, 1.75rem); line-height: 1.2; }

h1 em, h2 em { font-style: italic; color: var(--accent); }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

ul { margin: 0; padding: 0; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--on-ink);
  padding: 0.75rem 1rem;
}
.skip-link:focus { top: 1rem; }

/* 3. Layout ---------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
  display: grid;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

@media (min-width: 900px) {
  .section-head {
    grid-template-columns: 1fr 1.6fr;
    gap: 4rem;
    align-items: end;
  }
  .section-head h2 { margin: 0; }
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
}
.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
}

.lede {
  font-size: clamp(1.125rem, 2.2vw, 1.3125rem);
  color: var(--muted);
  max-width: 38rem;
}

/* 4. Header / nav ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  min-height: 4.25rem;
  padding-block: 0.75rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--accent); font-style: italic; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  padding: 0.5rem 0.85rem;
  min-height: 44px;
  cursor: pointer;
}
.nav-toggle-bars { width: 16px; height: 10px; position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
}
.nav-toggle-bars::before { top: 0; }
.nav-toggle-bars::after { bottom: 0; }

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
}
.site-nav a:not(.btn) {
  display: inline-block;
  padding-block: 0.6rem;
  font-size: 0.9375rem;
  text-decoration: none;
}
.site-nav a:not(.btn):hover { text-decoration: underline; }

/* Without JS: nav simply wraps below the wordmark. With JS on small screens: toggle. */
@media (max-width: 859px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; width: 100%; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: 0.5rem 1rem;
  }
  .js .site-nav li { border-top: 1px solid var(--line); }
  .js .site-nav a:not(.btn) { display: block; padding-block: 0.9rem; font-size: 1.0625rem; }
  .js .site-nav .btn { margin-top: 1rem; width: 100%; }
  .site-nav { width: 100%; }
}
@media (min-width: 860px) {
  .header-inner { flex-wrap: nowrap; }
}

/* 5. Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--on-ink); }
.btn-small { min-height: 44px; padding: 0.55rem 1rem; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* 6. Sections -------------------------------------------------------------- */

/* Hero */
.hero { padding-block: clamp(3rem, 9vw, 7rem) var(--section-y); }
.hero-grid { display: grid; gap: clamp(2.5rem, 6vw, 5rem); }
.hero h1 { max-width: 12ch; }
.hero .lede { margin-bottom: 2rem; }
.hero-meta {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr 1fr; align-items: end; }
}

/* Image slots — clearly labelled placeholders the owner replaces */
.slot {
  position: relative;
  display: flex;
  align-items: flex-end;
  margin: 0;
  background-color: var(--surface);
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(30, 28, 25, 0.045) 14px 15px);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.slot-wide { aspect-ratio: 3 / 2; }
.slot-square { aspect-ratio: 1 / 1; }
.slot figcaption, .slot .slot-label {
  margin: 1rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg);
  border: 1px dashed var(--muted);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Problem */
.problem-list {
  list-style: none;
  display: grid;
  gap: 0;
  counter-reset: problem;
}
.problem-list li {
  display: grid;
  gap: 0.5rem 2rem;
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  counter-increment: problem;
}
.problem-list li:last-child { border-bottom: 1px solid var(--line); }
.problem-list li::before {
  content: "0" counter(problem);
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent);
}
.problem-list h3 { margin: 0; }
.problem-list p { color: var(--muted); max-width: 34rem; }
@media (min-width: 760px) {
  .problem-list li { grid-template-columns: 4rem 1fr 1.3fr; align-items: baseline; }
}

/* Services — ruled columns, not boxed cards */
.services {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--ink);
}
.service {
  padding-block: 2rem 2.5rem;
  border-bottom: 1px solid var(--line);
}
.service-num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: block;
}
.service p { color: var(--muted); }
.outcomes { list-style: none; margin-top: 1.5rem; }
.outcomes li {
  position: relative;
  padding: 0.65rem 0 0.65rem 1.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.9875rem;
}
.outcomes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.2rem;
  width: 0.7rem;
  height: 1px;
  background: var(--accent);
}
@media (min-width: 900px) {
  .services { grid-template-columns: repeat(3, 1fr); }
  .service { padding: 2.5rem 2rem 2.5rem; border-bottom: 0; border-left: 1px solid var(--line); }
  .service:first-child { padding-left: 0; border-left: 0; }
  .service:last-child { padding-right: 0; }
}

/* Process */
.steps {
  list-style: none;
  display: grid;
  gap: 2.5rem;
  counter-reset: step;
}
.step { counter-increment: step; position: relative; }
.step::before {
  content: counter(step);
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 5rem);
  line-height: 1;
  color: var(--accent);
  margin-bottom: 1rem;
  font-variation-settings: "opsz" 144;
}
.step h3 { margin-bottom: 0.5rem; }
.step p { color: var(--muted); font-size: 1rem; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(2, 1fr); gap: 3rem; } }
@media (min-width: 1000px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  .step { padding-top: 1.5rem; border-top: 1px solid var(--ink); }
}

/* Audit — dark band */
.band-dark {
  background: var(--ink);
  color: var(--on-ink);
  border-top: 0 !important;
}
.band-dark .eyebrow, .band-dark .lede, .band-dark p { color: #c9c1b5; }
.band-dark h2 em { color: #e3a184; }
.band-dark .btn-primary { background: var(--on-ink); border-color: var(--on-ink); color: var(--ink); }
.band-dark .btn-primary:hover { background: #ffffff; border-color: #ffffff; color: var(--ink); }
.band-dark .btn-ghost { border-color: var(--on-ink); color: var(--on-ink); }
.band-dark .btn-ghost:hover { background: var(--on-ink); color: var(--ink); }
.band-dark a:not(.btn):hover { color: #e3a184; }

.audit-grid { display: grid; gap: 3rem; }
@media (min-width: 900px) { .audit-grid { grid-template-columns: 1fr 1.25fr; gap: 5rem; } }

.checklist { list-style: none; }
.checklist li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.25rem 1rem;
  padding-block: 1.25rem;
  border-top: 1px solid rgba(245, 241, 234, 0.18);
}
.checklist li:last-child { border-bottom: 1px solid rgba(245, 241, 234, 0.18); }
.checklist .tick {
  grid-row: span 2;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.2rem;
  border: 1px solid #e3a184;
  border-radius: 50%;
  position: relative;
}
.checklist .tick::after {
  content: "";
  position: absolute;
  left: 0.48rem;
  top: 0.28rem;
  width: 0.35rem;
  height: 0.65rem;
  border: solid #e3a184;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.checklist strong { font-weight: 500; color: var(--on-ink); }
.checklist span:not(.tick) { color: #c9c1b5; font-size: 0.9875rem; }

.audit-note { margin-top: 2rem; font-size: 0.9375rem; }

/* About */
.about-grid { display: grid; gap: 2.5rem; }
.about-grid .slot { max-width: 26rem; }
@media (min-width: 900px) {
  .about-grid { grid-template-columns: 0.8fr 1.2fr; gap: 5rem; align-items: start; }
}
.about-copy p { max-width: 36rem; }
.placeholder-note {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--muted);
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Contact */
.contact-grid { display: grid; gap: 3.5rem; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1.4fr; gap: 5rem; } }

.contact-details { list-style: none; margin-top: 2rem; }
.contact-details li { padding-block: 1rem; border-top: 1px solid var(--line); }
.contact-details li:last-child { border-bottom: 1px solid var(--line); }
.contact-details .label {
  display: block;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

/* City pages */
.prose { max-width: 40rem; }
.prose h2 { margin-top: 0; }
.two-col { display: grid; gap: 3rem; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; gap: 5rem; } }

.areas { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--ink); }
.area { padding-block: 2rem; border-bottom: 1px solid var(--line); }
.area h3 { margin-bottom: 0.5rem; }
.area p { color: var(--muted); }
@media (min-width: 900px) {
  .areas { grid-template-columns: repeat(3, 1fr); }
  .area { padding: 2rem 2rem 2.5rem; border-bottom: 0; border-left: 1px solid var(--line); }
  .area:first-child { padding-left: 0; border-left: 0; }
  .area:last-child { padding-right: 0; }
}

.fix-list { list-style: none; counter-reset: fix; }
.fix-list li {
  counter-increment: fix;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}
.fix-list li:last-child { border-bottom: 1px solid var(--line); }
.fix-list li::before {
  content: "0" counter(fix);
  font-family: var(--font-display);
  color: var(--accent);
}
.fix-list strong { display: block; font-weight: 500; margin-bottom: 0.2rem; }
.fix-list span { color: var(--muted); }

.breadcrumb { font-size: 0.875rem; color: var(--muted); margin-bottom: 2rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; }

.cta-band { text-align: left; }
.cta-band h2 { max-width: 18ch; }

/* Simple pages (thanks, 404) */
.simple-page { min-height: 70vh; display: flex; align-items: center; }
.simple-page h1 { max-width: 14ch; }

/* 7. Forms ----------------------------------------------------------------- */
.form { display: grid; gap: 1.25rem; }
.form-row { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.9375rem; font-weight: 500; }
.field .optional { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fbf9f5;
  border: 1px solid #b9ae9f;
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 1.25rem) 50%, calc(100% - 0.9rem) 50%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.field-hint { font-size: 0.875rem; color: var(--muted); }
.form-privacy { font-size: 0.875rem; color: var(--muted); }
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* 8. Footer ---------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--ink);
  padding-block: 3.5rem 2.5rem;
  font-size: 0.9375rem;
}
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid h2 {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.footer-grid ul { list-style: none; }
.footer-grid li { padding-block: 0.3rem; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }
.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

/* 9. Motion ---------------------------------------------------------------- */
/* Content is visible by default; only hidden for animation once JS has loaded. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* 10. Utilities ------------------------------------------------------------ */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.mt-2 { margin-top: 2rem; }
.muted { color: var(--muted); }
