/* Project Nehemiah — the organisation's home page (/).
 *
 * Its own look, separate from Guardian's (assets/site.css). It takes its cues from the
 * Project Nehemiah logo: crimson on parchment, engraved capitals, a dry-brush mark. The
 * grit borrows NCM's techniques (the New Creation Movement site), all made in code: a
 * photocopy grain over the whole page, brush-torn dividers, thick rules, square buttons
 * with a hard offset shadow. No texture images, so nothing to license and little to load.
 *
 * Fonts are self-hosted (the site's Content-Security-Policy allows no others):
 *   Cinzel       headings, the engraved capitals of the logo lockup   (SIL OFL 1.1)
 *   Newsreader   body text, NCM's serif                              (SIL OFL 1.1)
 *   Great Marker one hand-painted accent, from NCM                   (Apache 2.0; a
 *                derivative of Permanent Marker by Font Diner — see fonts/LICENSE-GreatMarker-*)
 */

@font-face { font-family: "Cinzel"; font-weight: 400 900; font-display: swap; src: url("../fonts/Cinzel.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 200 800; font-style: normal; font-display: swap; src: url("../fonts/Newsreader.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 200 800; font-style: italic; font-display: swap; src: url("../fonts/Newsreader-Italic.woff2") format("woff2"); }
@font-face { font-family: "Great Marker"; font-display: swap; src: url("../fonts/GreatMarker.woff2") format("woff2"); }

/* Parchment and crimson. Light only, on purpose: the brand is ink on paper. */
:root {
  --paper:    #EFE8DD;   /* the logo's own ground */
  --paper-2:  #E5DCCC;
  --ink:      #1E1A17;
  --ink-2:    #4A423B;
  --crimson:  #8B1A1A;   /* the logo's red */
  --crimson-2:#6B1212;
  --blush:    #D88A7E;   /* crimson lifted for use on the dark story band */
  --rule:     rgba(30, 26, 23, .16);
  --display:  "Cinzel", "Trajan Pro", Georgia, serif;
  --serif:    "Newsreader", Georgia, "Times New Roman", serif;
  --brush:    "Great Marker", "Marker Felt", cursive;
  --ease:     cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

* { 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-color: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 19px; line-height: 1.6; font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  /* Parchment mottling: big soft blotches under everything. */
  background-image:
    radial-gradient(ellipse 60% 40% at 15% 10%, rgba(217, 205, 184, .55), transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 55%, rgba(217, 205, 184, .45), transparent 70%),
    radial-gradient(ellipse 70% 45% at 40% 95%, rgba(217, 205, 184, .5), transparent 70%);
  background-attachment: fixed;
}
/* Photocopy grain over the whole page (NCM's technique): fractal noise turned into dark
   speckle and multiplied in. pointer-events off so it never eats a click. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  mix-blend-mode: multiply; opacity: .2;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

a { color: var(--crimson); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--crimson-2); }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.12; letter-spacing: .01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Small engraved label between two tapered rules, like "PROJECT" in the logo. */
.eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0;
  font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .32em;
  text-transform: uppercase; color: var(--crimson);
}
.eyebrow::before, .eyebrow::after { content: ""; height: 1.5px; width: min(90px, 14vw); flex: none;
  background: linear-gradient(90deg, transparent, currentColor); }
.eyebrow::after { background: linear-gradient(270deg, transparent, currentColor); }

/* The traced mark is a mask, so CSS decides its colour. */
.pn-mark { display: block; aspect-ratio: 412 / 381; background: currentColor; color: var(--crimson);
  -webkit-mask: url("nehemiah-mark.svg") no-repeat center / contain;
          mask: url("nehemiah-mark.svg") no-repeat center / contain; }

/* ---- header ------------------------------------------------------------------------- */
.head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.head .wrap { display: flex; align-items: center; gap: 20px; height: 66px; }
.head .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.head .brand .pn-mark { width: 38px; }
.head .brand span { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .18em; }
.head nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.head nav a:not(.btn) { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2); text-decoration: none; }
.head nav a:not(.btn):hover { color: var(--crimson); }
@media (max-width: 760px) { .head nav a.opt { display: none; } .head .brand span { font-size: 13px; letter-spacing: .14em; } }

/* Square, hard-edged buttons with an offset shadow on hover (NCM). */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border: 2px solid var(--crimson); background: var(--crimson); color: var(--paper);
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.btn:hover { color: var(--paper); transform: translate(-3px, -3px); box-shadow: 3px 3px 0 var(--ink); }
.head .btn { min-height: 40px; padding: 0 14px; font-size: 12px; }

/* ---- hero --------------------------------------------------------------------------- */
.hero { text-align: center; padding: 8vh 24px 4vh; }
.hero .pn-mark { width: min(380px, 72vw); margin: 0 auto; }
.hero .lockup { margin-top: 28px; }
.hero h1 { font-weight: 700; font-size: clamp(46px, 9vw, 108px); letter-spacing: .06em; line-height: 1;
  color: var(--crimson); margin-top: 12px; }
.hero .under { width: min(520px, 80vw); height: 1.5px; margin: 22px auto 0;
  background: linear-gradient(90deg, transparent, var(--crimson) 20%, var(--crimson) 80%, transparent); }
.mission { max-width: 760px; margin: 40px auto 0; font-size: clamp(24px, 3.2vw, 36px); line-height: 1.3;
  font-style: italic; text-wrap: balance; }
.mission b { font-style: normal; font-weight: 600; color: var(--crimson); }
/* The one hand-painted line, tilted like a note slapped across the page. */
.brush-note { display: inline-block; margin-top: 30px; font-family: var(--brush); font-size: clamp(26px, 3.6vw, 40px);
  color: var(--crimson); transform: rotate(-4deg); line-height: 1.1; }

/* ---- brush-torn divider (NCM): a band pushed around by stretched fractal noise ------- */
.tear { display: block; width: 100%; height: 48px; color: var(--crimson); }

/* ---- sections ----------------------------------------------------------------------- */
.band { padding: 11vh 0; position: relative; }
.band.dark { background: var(--ink); color: var(--paper); }
.band.dark .eyebrow { color: var(--blush); }
.section-title { font-size: clamp(32px, 4.6vw, 56px); text-align: center; margin-top: 20px; }
.section-lead { max-width: 680px; margin: 22px auto 0; text-align: center; color: var(--ink-2); font-size: 20px; text-wrap: balance; }

/* Stats: big crimson figures, every one with its source printed under it. */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 56px; border-top: 2px solid var(--ink); }
.stat { padding: 34px 30px 30px; border-bottom: 2px solid var(--ink); }
.stat:nth-child(odd) { border-right: 2px solid var(--ink); }
.stat .fig { font-family: var(--display); font-weight: 700; font-size: clamp(52px, 7vw, 88px); line-height: 1; color: var(--crimson); }
.stat .cap { margin-top: 14px; font-size: 20px; line-height: 1.45; max-width: 32ch; }
.stat .src { margin-top: 14px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.stat .src a { color: var(--ink-2); }
.stats-note { margin: 22px auto 0; max-width: 720px; font-size: 14px; color: var(--ink-2); text-align: center; text-wrap: balance; }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; }
  .stat:nth-child(odd) { border-right: 0; }
  .stat { padding: 28px 4px; }
}

/* The Nehemiah story, line by line, on the dark band. */
.story-line { max-width: 940px; margin: 0 auto; text-align: center; padding: 8vh 24px; }
.story-line .big { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4.4vw, 54px); line-height: 1.15; text-wrap: balance; }
.story-line .big em { font-style: normal; color: var(--blush); }
.story-line .sub { margin: 18px auto 0; max-width: 680px; color: #CFC6B8; font-size: 20px; text-wrap: balance; }
.verse { max-width: 860px; margin: 4vh auto 0; text-align: center; font-style: italic; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.25; text-wrap: balance; }
.verse cite { display: block; margin-top: 18px; font-family: var(--display); font-style: normal; font-weight: 700;
  font-size: 13px; letter-spacing: .28em; color: var(--blush); }
.story-close { max-width: 640px; margin: 40px auto 0; text-align: center; color: #CFC6B8; font-size: 20px; text-wrap: balance; }

/* Tools. Guardian keeps its own identity inside its card: dark ground, gold, its wordmark. */
.tools { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; margin-top: 56px; }
.tool { padding: 36px 34px; border: 2px solid var(--ink); }
.tool.guardian { background: #181A1D; color: #F3F2EE; border-color: #181A1D; box-shadow: 8px 8px 0 var(--crimson); }
.tool.guardian .row { display: flex; align-items: center; gap: 14px; }
.tool.guardian .gmark { width: 46px; height: 46px; display: block; }
.tool.guardian .gword { display: block; height: 34px; aspect-ratio: 1928 / 426; background: #CFB881;
  -webkit-mask: url("../guardian-wordmark.svg") no-repeat center / contain;
          mask: url("../guardian-wordmark.svg") no-repeat center / contain; }
.tool.guardian p { margin-top: 20px; color: #B8BDC6; font-size: 19px; }
.tool .tag { display: inline-block; padding: 4px 10px; border: 1.5px solid currentColor;
  font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.tool.guardian .foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 24px; }
.tool.guardian .tag { color: #CFB881; }
.tool.guardian a.go { color: #CFB881; font-family: var(--display); font-weight: 700; font-size: 13px;
  letter-spacing: .16em; text-transform: uppercase; text-decoration: none; }
.tool.guardian a.go:hover { text-decoration: underline; }
.tool.next { border-style: dashed; display: flex; flex-direction: column; justify-content: center; }
.tool.next h3 { font-size: 22px; }
.tool.next p { margin-top: 12px; color: var(--ink-2); }
@media (max-width: 860px) { .tools { grid-template-columns: 1fr; } }

/* Contact. */
.contact { text-align: center; }
.contact .soon { display: inline-block; margin-top: 28px; padding: 14px 22px; border: 2px dashed var(--crimson);
  font-family: var(--display); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: 14px; color: var(--crimson); }

/* ---- footer ------------------------------------------------------------------------- */
.foot { border-top: 6px solid var(--crimson); padding: 40px 0 48px; font-size: 15px; color: var(--ink-2); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; justify-content: space-between; }
.foot .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.foot .brand .pn-mark { width: 30px; }
.foot .brand span { font-family: var(--display); font-weight: 700; letter-spacing: .16em; font-size: 13px; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot nav a { color: var(--ink-2); }

/* Reveal on scroll. */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
