/* Mercy & Method — the one stylesheet for mercyandmethod.com.
   Brand: docs/brand-voice.md Part B and D20 (font option A).
   Fonts are self-hosted on purpose: loading them from Google sends
   visitors' IP addresses to Google (a GDPR problem in the EU). */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/fraunces-700.woff2) format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/fraunces-italic-500.woff2) format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(/fonts/source-sans-3.woff2) format("woff2");
}
@font-face {
  font-family: "Josefin Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/josefin-sans-400.woff2) format("woff2");
}
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/caveat-500.woff2) format("woff2");
}
/* Fraunces and Source Sans lack the Arabic glyph ﷺ. Amiri fills in for
   Arabic characters only; it is never downloaded unless a page uses one. */
@font-face {
  font-family: "Amiri";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/amiri-arabic.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* ---------- Brand tokens ---------- */
:root {
  --navy: #0B2A4A;      /* ink: headlines, body text */
  --terra: #BE5A2D;     /* accent: quotes, buttons, underlines (large or bold text only: 3.9:1 on cream) */
  --teal: #2F7A80;      /* secondary: tagline, focus ring */
  --teal-light: #559196;/* decoration only, never small text */
  --cream: #F8EEDE;     /* main background */
  --white: #FDFCFB;     /* clean paper */
  --sage: #D9E4DC;      /* taped notes */
  --night: #0E1F32;     /* faith sections only */
  --gold: #F3B961;      /* faith sections only */
  --rose: #EB7559;      /* faith sections only */

  --serif: "Fraunces", "Amiri", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Amiri", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --caps: "Josefin Sans", var(--sans);
  --hand: "Caveat", "Comic Sans MS", cursive;

  --wrap: 68rem;
  --gutter: 1.25rem;
  --radius: 14px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
h1 { font-size: clamp(1.85rem, 6.4vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 5.4vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1rem; }
a { color: var(--navy); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--terra); text-decoration-thickness: 2px; }
strong, b { font-weight: 650; }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 10;
  background: var(--navy); color: var(--white);
  padding: 0.6rem 1rem; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 0.5rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 3rem 0; }
.paper { background: var(--white); }
.grid-paper {
  background-color: var(--white);
  background-image:
    linear-gradient(#dfe7ee 1px, transparent 1px),
    linear-gradient(90deg, #dfe7ee 1px, transparent 1px);
  background-size: 22px 22px;
}

/* Small spaced capitals above headings */
.kicker {
  font-family: var(--caps);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0 0 0.6rem;
}
.kicker::before {
  content: ""; display: inline-block; width: 1.4rem; height: 3px;
  background: var(--terra); border-radius: 2px;
  vertical-align: 0.3em; margin-right: 0.55rem;
}

/* The tagline: Josefin Sans, spaced capitals. Teal deep needs white paper
   (4.9:1); on cream it would fall just short of AA for small text. */
.tagline {
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.95rem;
  color: var(--teal);
  margin: 0;
}
.tagline span { white-space: nowrap; }

/* Quotes: Fraunces italic, terracotta, always at a large size */
.quote {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  color: var(--terra);
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0 0 1rem;
}

.lead { font-size: 1.2rem; }
.small { font-size: 0.95rem; }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--terra);
  color: var(--white);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.2rem;          /* large bold text: 4.4:1 passes AA */
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  padding: 0.9rem 1.5rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(11, 42, 74, 0.18);
}
.btn:hover { background: #a94f27; text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(11, 42, 74, 0.18); }
.btn-outline {
  background: transparent; color: var(--navy);
  box-shadow: inset 0 0 0 2px var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-block { display: block; width: 100%; }

/* ---------- Header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid #eadfcc; }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.4rem;
}
.site-header .logo img { width: 190px; height: auto; }
.header-link {
  font-weight: 600; font-size: 1rem; white-space: nowrap;
  color: var(--navy);
}

/* ---------- Art ---------- */
.art { border-radius: var(--radius); box-shadow: 0 8px 24px rgba(11, 42, 74, 0.12); }
.cover { border-radius: 6px; box-shadow: 0 10px 28px rgba(11, 42, 74, 0.22); transform: rotate(-1.5deg); }

/* ---------- Home: hero ---------- */
.hero { padding: 2rem 0 2.5rem; }
.hero h1 { margin-bottom: 0.9rem; }
.hero .tagline { margin: 1.1rem 0 1.4rem; }
.hero .art { margin-top: 2rem; }

/* ---------- Home: guide ---------- */
.guide { display: grid; gap: 1.8rem; align-items: center; }
.guide .cover { width: min(72%, 300px); margin: 0 auto; }

/* ---------- Home: pillars ---------- */
.pillars { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.25rem; }
/* Phones: small square thumbnail beside the text. Desktop: image on top. */
.pillar {
  background: var(--cream); border-radius: var(--radius); overflow: hidden;
  display: flex; align-items: stretch;
}
.pillar img { width: 112px; flex: none; object-fit: cover; }
.pillar div { padding: 0.9rem 1rem 1rem; }
.pillar h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.pillar p { font-size: 1rem; line-height: 1.45; }
.pillar p { margin: 0; }
.pillar .num { font-family: var(--serif); color: var(--terra); margin-right: 0.35rem; }
/* The faith pillar uses the Lamp-lit Night palette (faith sections only) */
.pillar.night { background: var(--night); color: var(--white); }
.pillar.night h3 { color: var(--gold); }
.pillar.night .num { color: var(--rose); }

/* ---------- Home: Mercy & Method ---------- */
.mm { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
.mm-card { background: var(--white); border-radius: var(--radius); padding: 1.3rem 1.3rem 1.1rem; }
.mm-card img { border-radius: 10px; margin-bottom: 1rem; width: 100%; }
.mm-card h3 .word { display: block; font-family: var(--caps); font-weight: 400; font-size: 0.85rem; letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 0.3rem; }
.both { text-align: center; margin: 2.2rem auto 0; max-width: 34rem; }
.both h3 { font-size: clamp(1.7rem, 6vw, 2.3rem); margin-bottom: 0.4rem; }
.both .quote { margin: 0; }

/* ---------- Home: who ---------- */
.who { display: grid; gap: 1.8rem; align-items: center; }

/* ---------- Home: how we check ---------- */
.checks { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; counter-reset: c; }
.checks li {
  background: var(--white); border: 1.5px solid #d3dde6; border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.1rem 3.6rem; position: relative; counter-increment: c;
}
.checks li::before {
  content: counter(c); position: absolute; left: 1.1rem; top: 0.9rem;
  font-family: var(--serif); font-weight: 700; font-size: 1.7rem; color: var(--terra);
}
.checks h3 { font-size: 1.15rem; margin-bottom: 0.3rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0; }
.checks p { margin: 0; }

/* Taped sage note in Caveat */
.note {
  background: var(--sage); color: var(--navy);
  font-family: var(--hand); font-weight: 500; font-size: 1.65rem; line-height: 1.2;
  padding: 1.1rem 1.4rem; border-radius: 4px; max-width: 22rem;
  transform: rotate(-1.5deg); box-shadow: 0 5px 12px rgba(0, 0, 0, 0.12);
  position: relative; margin: 2.2rem auto 0.5rem; text-align: center;
}
.note::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 84px; height: 24px;
  margin-left: -42px; background: rgba(190, 90, 45, 0.65); transform: rotate(3deg);
}

/* ---------- /calm ---------- */
.calm-top { padding: 0.9rem 0 2rem; }
.guide-id { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.7rem; }
.guide-id img { width: 50px; border-radius: 3px; box-shadow: 0 4px 12px rgba(11, 42, 74, 0.25); transform: rotate(-2deg); flex: none; }
.guide-id .kicker { margin: 0 0 0.15rem; font-size: 0.75rem; }
.guide-id .kicker::before { display: none; }
.guide-id p.title { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; margin: 0; line-height: 1.15; }
.calm-top h1 { font-size: clamp(1.45rem, 6vw, 2.5rem); margin-bottom: 0.9rem; }
.calm-cover-lg { display: none; }

.form-card {
  background: var(--white); border-radius: var(--radius);
  border: 1.5px solid #e3d6c0; padding: 1rem 1rem 1.1rem;
  box-shadow: 0 8px 22px rgba(11, 42, 74, 0.08);
}
.field { margin-bottom: 0.65rem; }
.field label { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
.field input {
  width: 100%; font: inherit; font-size: 1.1rem; color: var(--navy);
  padding: 0.6rem 0.85rem; border: 1.5px solid #8a98a8; border-radius: 10px;
  background: #fff;
}
.field input:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.consent { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0.3rem 0 0.85rem; font-size: 1rem; line-height: 1.4; cursor: pointer; }
.consent input {
  flex: none; width: 1.4rem; height: 1.4rem; margin: 0.05rem 0 0;
  accent-color: var(--teal); cursor: pointer;
}
.under-form { margin: 0.8rem 0 0; font-size: 0.95rem; text-align: center; }

.inside { list-style: none; padding: 0; margin: 1rem 0 0; }
.inside li { padding-left: 2rem; position: relative; margin-bottom: 0.65rem; }
.inside li::before {
  content: ""; position: absolute; left: 0.1rem; top: 0.45rem;
  width: 0.75rem; height: 0.42rem; border-left: 3px solid var(--teal); border-bottom: 3px solid var(--teal);
  transform: rotate(-45deg);
}
.previews { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.previews img { border-radius: 4px; box-shadow: 0 4px 14px rgba(11, 42, 74, 0.18); width: 100%; }
.previews figcaption { font-size: 0.85rem; margin-top: 0.4rem; text-align: center; }
.trust { display: flex; gap: 1rem; align-items: flex-start; }
.trust img { width: 72px; flex: none; }

/* ---------- /thanks, 404, privacy ---------- */
.simple { padding: 2.2rem 0 3rem; }
.simple .art { margin: 1.5rem 0; width: 100%; max-width: 420px; }
.steps { padding-left: 1.3rem; }
.steps li { margin-bottom: 0.5rem; }
.prose { max-width: 42rem; }
.prose h2 { font-size: 1.45rem; margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 1rem; margin: 0 0 1rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.55rem 0.5rem; border-bottom: 1px solid #e0d3bd; }
.prose th { font-weight: 700; }
.updated { font-size: 0.95rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--cream); padding: 2.5rem 0 2rem; font-size: 1rem; }
.site-footer a { color: var(--cream); }
.site-footer .brand { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; margin: 0 0 0.3rem; }
.site-footer .brand .amp { color: var(--rose); }
.site-footer .tagline { color: var(--sage); font-size: 0.85rem; margin-bottom: 1.4rem; }
.foot-links { list-style: none; padding: 0; margin: 0 0 1.4rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.foot-links a { font-weight: 600; }
.clinical {
  border-top: 1px solid rgba(248, 238, 222, 0.25); padding-top: 1.2rem;
  font-size: 0.95rem; max-width: 44rem;
}
.copy { font-size: 0.9rem; margin: 1rem 0 0; opacity: 0.9; }

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
  :root { --gutter: 2rem; }
  .section { padding: 4.5rem 0; }
  .site-header .logo img { width: 250px; }
  .hero { padding: 3.5rem 0 4rem; }
  .hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; }
  .hero .art { margin-top: 0; }
  .guide { grid-template-columns: 0.8fr 1.2fr; gap: 3rem; }
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .pillar { flex-direction: column; }
  .pillar img { width: 100%; aspect-ratio: 4 / 3; }
  .pillar div { padding: 1rem 1.2rem 1.3rem; }
  .pillar h3 { font-size: 1.3rem; }
  .pillar p { font-size: 1.125rem; }
  .mm { grid-template-columns: 1fr 1fr; }
  .who { grid-template-columns: 1fr 1.1fr; gap: 3rem; }
  .checks { grid-template-columns: 1fr 1fr; }
  .calm-top .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: start; }
  .calm-cover-lg { display: block; width: min(100%, 320px); margin: 1.5rem auto 0; }
  .guide-id img { display: none; }
  .previews { gap: 1.25rem; max-width: 40rem; }
}

/* ---------- Motion v2, "more" (🟡 PROPOSED, docs/website-motion.md) ----------
   Faraz on v1 (5 Oct): "more". v2 is more visible, still calm: nothing
   bounces, spins or flashes, and every motion settles and stops.
   CSS only, no JavaScript (D19). Everything sits inside
   prefers-reduced-motion: no-preference, so phones set to "reduce motion"
   get today's still site. Scroll effects sit inside @supports, so a browser
   without them (Firefox today) also gets the still site. Only opacity,
   transforms and clip-path move: no layout shift, nothing stays hidden.
   Easing matches the reels (Video Studio: power2.out, sine.inOut). */
:root {
  --ease-calm: cubic-bezier(0.25, 0.46, 0.45, 0.94);   /* = power2.out */
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);         /* a longer, softer settle */
  --ease-drift: cubic-bezier(0.37, 0, 0.63, 1);        /* = sine.inOut */
}

@media (prefers-reduced-motion: no-preference) {

  /* 1 · Arrival: the first screen settles in, one line after another.
     The headline itself never fades, so it shows at once. */
  .hero .lead, .hero .tagline, .hero .btn, .simple .kicker, .simple .lead, .simple .btn {
    animation: mm-rise 1s var(--ease-soft) both;
  }
  .hero h1, .simple h1 { animation: mm-lift 1s var(--ease-soft) both; }
  .hero .lead, .simple .lead { animation-delay: 0.15s; }
  .hero .tagline { animation-delay: 0.3s; }
  .hero .btn, .simple .btn { animation-delay: 0.45s; }
  /* the painting opens like a curtain lifting, then keeps breathing slowly */
  .hero .art, .simple .art {
    animation: mm-unveil 1.8s var(--ease-soft) both 0.1s, mm-breathe 22s var(--ease-drift) 2s infinite alternate;
  }

  @keyframes mm-rise { from { opacity: 0; transform: translateY(22px); } }
  @keyframes mm-lift { from { transform: translateY(12px); } }
  @keyframes mm-unveil {
    from { opacity: 0; clip-path: inset(18% 6% 18% 6% round 24px); transform: scale(1.08); }
    to { opacity: 1; clip-path: inset(0 0 0 0 round 14px); transform: scale(1); }
  }
  @keyframes mm-breathe { to { transform: scale(1.035); } }

  /* 2 · Buttons: a lift and a soft glow under the finger or pointer */
  .btn { transition: transform 0.3s var(--ease-calm), box-shadow 0.3s var(--ease-calm); }
  .btn:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(190, 90, 45, 0.28); }
  .btn:active { transform: translateY(0); box-shadow: none; }

  /* 3 · Page to page: a soft cross-fade with a small rise; the header stays still */
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: mm-header; }
  ::view-transition-old(root) { animation: 0.3s var(--ease-calm) both mm-fade-out; }
  ::view-transition-new(root) { animation: 0.5s var(--ease-soft) both mm-fade-in; }
  @keyframes mm-fade-out { to { opacity: 0; } }
  @keyframes mm-fade-in { from { opacity: 0; transform: translateY(14px); } }

  @supports (animation-timeline: view()) {
    /* 4 · Reveal: headings, cards and lists rise into place as they arrive */
    .section h2, .section .lead, .pillar, .mm-card, .both, .checks li, .note,
    .inside li, .previews li, .guide .cover, .who > div, .site-footer .brand, .site-footer .tagline {
      animation: mm-reveal both var(--ease-soft);
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }
    @keyframes mm-reveal { from { opacity: 0; translate: 0 44px; scale: 0.97; } }  /* `translate`/`scale`, so tilted items keep their tilt */

    /* cards and list items follow one another */
    .pillar:nth-child(2), .mm-card:nth-child(2), .previews li:nth-child(2), .checks li:nth-child(2), .inside li:nth-child(2) { animation-range: entry 8% cover 22%; }
    .pillar:nth-child(3), .previews li:nth-child(3), .checks li:nth-child(3), .inside li:nth-child(3) { animation-range: entry 16% cover 28%; }
    .checks li:nth-child(4), .inside li:nth-child(4) { animation-range: entry 24% cover 34%; }

    /* the small terra line before each kicker draws itself in */
    .section .kicker::before {
      transform-origin: left center;
      animation: mm-draw both var(--ease-soft);
      animation-timeline: view();
      animation-range: entry 20% cover 30%;
    }
    @keyframes mm-draw { from { transform: scaleX(0); } }

    /* 5 · Paintings: open like a curtain lifting as they arrive, then drift
       slower than the page (parallax) */
    .section .art {
      animation: mm-open both var(--ease-soft), mm-drift both linear;
      animation-timeline: view(), view();
      animation-range: entry 0% cover 40%, cover 0% cover 100%;
    }
    @keyframes mm-open {
      from { opacity: 0.2; clip-path: inset(14% 8% 14% 8% round 24px); scale: 1.1; }
      to { opacity: 1; clip-path: inset(0 0 0 0 round 14px); scale: 1; }
    }
    @keyframes mm-drift { from { transform: translateY(40px); } to { transform: translateY(-40px); } }

    .mm-card img {  /* the Mercy and Method pictures open the same way, without drift */
      animation: mm-open both var(--ease-soft);
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }

    /* the pillar thumbnails settle from a gentle zoom (the card clips them) */
    .pillar img {
      animation: mm-zoom both var(--ease-soft);
      animation-timeline: view();
      animation-range: entry 0% cover 45%;
    }
    @keyframes mm-zoom { from { scale: 1.18; } }
  }
}
