/* ==========================================================================
   fe.css — the faith-institutions landing
   Pairs with main.css the way story.css does on the home: no token overrides,
   because this page lives in the default dark theme. Everything here is
   layout, plus the diagram layer further down.

   Nothing in this file hides content. Diagram from-states are set by
   JavaScript at runtime and carry a watchdog, exactly as on the home.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CARRIED OVER FROM edu.css
   The page spent its first release on paper. Five classes came from that
   stylesheet and were never about daylight: they are layout. Rebuilt here
   against the dark surfaces, with an outline where the light theme used a
   shadow, because a shadow does not read on Void.
   -------------------------------------------------------------------------- */
.hero--edu .hero__h1 {
  font-size: clamp(38px, 6.2vw, 92px);
  max-width: 17ch;
}
.edu-eyebrow {
  max-width: none;
}

.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-5);
}
.statgrid .metric {
  background: var(--surface-panel);
  outline: 1px solid var(--border-subtle);
  outline-offset: -1px;
  border-radius: var(--radius-sm);
  padding: var(--space-6);
}

.footer--min {
  padding-top: var(--space-7);
}
.footer--min .footer__legal {
  border-top: 0;
}

/* --------------------------------------------------------------------------
   2. DIAGRAM SHELL
   Every diagram is inline SVG with role="img", a <title> and a <desc> in the
   page language. The figure sits beside the prose, never instead of it.
   -------------------------------------------------------------------------- */
/* The shell sits one step darker than the pieces inside it, and that is a
   contrast decision, not a taste one. With the shell on --surface-panel the
   pieces landed on --surface-panel-nested, where --signal-text measures
   4.39:1 and fails AA for label-sized text. Dropping the shell to
   --void-lift puts every piece on --surface-panel instead, where the same
   blue clears at 4.76:1. */
.dgm {
  margin-top: var(--space-7);
  background: var(--void-lift);
  outline: 1px solid var(--border-subtle);
  outline-offset: -1px;
  border-radius: var(--radius-sm);
  padding: clamp(18px, 2.4vw, 32px);
}
.dgm--bare {
  background: none;
  outline: 0;
  padding: 0;
}
.dgm svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.dgm__cap {
  margin-top: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-mono-wide);
  color: var(--text-lo);
}

/* --- shared SVG vocabulary -------------------------------------------------
   Colour carries meaning on this page and only these three values are used:
   electric is the institution's own, grey is a third party, amber is what is
   wrong or confused. Text uses the AA-safe pair (signal-text / warn-text)
   because electric-500 is 3.65:1 on Void and amber-500 is a mark colour. */
.dgm .s-own {
  fill: var(--electric-500);
}
.dgm .s-own-stroke {
  stroke: var(--electric-500);
  fill: none;
}
.dgm .s-third {
  fill: var(--text-dim);
}
.dgm .s-third-stroke {
  stroke: var(--text-dim);
  fill: none;
}
.dgm .s-wrong {
  fill: var(--amber-500);
}
.dgm .s-wrong-stroke {
  stroke: var(--amber-500);
  fill: none;
}
.dgm .s-panel {
  fill: var(--surface-panel);
}
.dgm .s-rule {
  stroke: var(--border-subtle);
  fill: none;
}
.dgm .s-rule-hi {
  stroke: var(--border-strong);
  fill: none;
}

.dgm text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  fill: var(--text-lo);
}
.dgm .t-hi {
  fill: var(--text-hi);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.dgm .t-own {
  fill: var(--signal-text);
}
.dgm .t-wrong {
  fill: var(--warn-text);
}
.dgm .t-lg {
  font-size: 13px;
}
.dgm .t-sm {
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   3. RESPONSIVE
   Below 760px the diagrams stop being wide schematics and stack. Each SVG
   carries a second viewBox applied here, so the stacking is a layout change
   and not a scaled-down copy of the desktop drawing.
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .dgm {
    padding: var(--space-5);
  }
  .dgm text {
    font-size: 12px;
  }
  .dgm .t-sm {
    font-size: 11px;
  }
}

/* --------------------------------------------------------------------------
   G1 · THE JOURNEY OF A QUESTION
   Four stages in a row on desktop, one column on a phone. The labels are HTML
   so they reflow and keep their own type size at every width; only the
   connector is SVG, and it is decorative, so it carries aria-hidden.
   -------------------------------------------------------------------------- */
.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: stretch;
}
.flow__step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-right: 26px;
}
.flow__kind {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-mono-wide);
  color: var(--text-lo);
}
.flow__card {
  background: var(--surface-panel);
  outline: 1px solid var(--border-subtle);
  outline-offset: -1px;
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body);
  color: var(--text-mid);
}
.flow__card--q {
  border-left: 2px solid var(--border-strong);
}
.flow__card--a {
  border-left: 2px solid var(--electric-500);
  color: var(--text-hi);
}
.flow__set {
  display: grid;
  gap: 6px;
}
.flow__node {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.03em;
  color: var(--text-lo);
  padding: 7px 10px;
  border-radius: 4px;
  background: var(--surface-panel);
  outline: 1px solid var(--border-subtle);
  outline-offset: -1px;
}
/* What belongs to the institution. The blue is carried by the rule and the
   outline, not by the label: --signal-text sits at 4.39:1 on the nested panel
   and 4.08:1 once --electric-wash is laid over it, both under AA for text this
   size. Blue is the mark here, exactly as it is everywhere else in main.css. */
.flow__node--own {
  color: var(--text-hi);
  outline-color: var(--electric-500);
  border-left: 2px solid var(--electric-500);
  padding-left: 8px;
}
/* .dgm svg sets width:100% for the full-width schematics; this connector is a
   small fixed mark, so it needs to out-specify that rule rather than inherit
   it and blow up to the width of its step. */
.dgm .flow__arrow {
  position: absolute;
  top: 4px;
  right: 0;
  width: 18px;
  height: 10px;
  stroke: var(--border-strong);
  stroke-width: 1.5;
  fill: none;
}
/* The connector after the last stage would point at nothing. It is a
   decorative mark, never content, so removing it loses no information. */
.dgm .flow__step:last-child .flow__arrow {
  display: none;
}
@media (max-width: 760px) {
  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
  }
  .flow__step {
    padding-right: 0;
    padding-bottom: 22px;
  }
  .dgm .flow__arrow {
    top: auto;
    bottom: 2px;
    right: auto;
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
  }
}

/* --------------------------------------------------------------------------
   G2 · THE MATRIX
   Two questions crossed. Regime 1 and 3 are single cells; regime 2 is the
   whole bottom row, because when the question names nobody it no longer
   matters whether your site answers the topic. The bar in each cell is a
   proportion, never a measurement: no number is implied or printed.
   -------------------------------------------------------------------------- */
.mx {
  display: grid;
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  gap: 1px;
}
.mx__axis-x,
.mx__axis-y,
.mx__head {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-mono-wide);
  color: var(--text-lo);
  align-self: center;
}
.mx__axis-x {
  grid-column: 2 / 4;
  text-align: center;
  padding-bottom: var(--space-3);
}
.mx__axis-y {
  grid-row: 2 / 4;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  padding-right: var(--space-3);
  justify-self: center;
}
.mx__head {
  text-align: center;
  padding-bottom: var(--space-2);
}
.mx__cell {
  background: var(--surface-panel);
  outline: 1px solid var(--border-subtle);
  outline-offset: -1px;
  border-radius: var(--radius-sm);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.mx__cell--wide {
  grid-column: 2 / 4;
}
.mx__n {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--ls-mono-wide);
  color: var(--signal-text);
}
.mx__t {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-body-lg);
  letter-spacing: -0.01em;
  color: var(--text-hi);
  line-height: var(--lh-body-tight);
}
.mx__legend {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: 0.04em;
  color: var(--text-lo);
}
.dgm .mx__bar {
  width: 100%;
  height: 10px;
  display: block;
}
.mx__bar .b-own {
  fill: var(--electric-500);
}
.mx__bar .b-third {
  fill: var(--text-dim);
}
@media (max-width: 760px) {
  .mx {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
  .mx__axis-x,
  .mx__axis-y {
    grid-column: auto;
    grid-row: auto;
    writing-mode: horizontal-tb;
    transform: none;
    text-align: left;
    padding: 0;
  }
  .mx__head {
    text-align: left;
    padding: 0;
  }
  .mx__cell--wide {
    grid-column: auto;
  }
}

/* --------------------------------------------------------------------------
   G3 (two lenses)
   Inward and outward, side by side. Both viewBoxes are small (200 units) so
   that at phone widths the drawing scales UP rather than down: a 9px label in
   a 200-wide box renders larger, not smaller, when the box is 320px across.
   That is why these two are pure SVG while G1 is not.
   -------------------------------------------------------------------------- */
.lens {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}
.lens__pane {
  background: var(--surface-panel);
  outline: 1px solid var(--border-subtle);
  outline-offset: -1px;
  border-radius: var(--radius-sm);
  padding: var(--space-5);
}
.lens__t {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-mono-wide);
  color: var(--signal-text);
  margin-bottom: var(--space-4);
}
.lens__note {
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: 0.04em;
  color: var(--text-lo);
}
.dgm .lens__svg {
  width: 100%;
  height: auto;
}
.lens__svg .wire {
  stroke: var(--border-strong);
  fill: none;
  stroke-width: 1.5;
}
.lens__svg .wire-fill {
  fill: var(--void-lift);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}
.lens__svg .scan {
  stroke: var(--electric-500);
  stroke-width: 2;
}
.lens__svg .ring {
  stroke: var(--electric-500);
  fill: none;
  stroke-width: 1.5;
}
.lens__svg .eng {
  fill: var(--surface-panel);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}
.lens__svg text {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--text-lo);
}
.lens__svg .core {
  fill: var(--electric-500);
}
@media (max-width: 760px) {
  .lens {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------------------
   G4 (the five checks)
   The same wireframe as G3, now carrying five numbered markers. The SVG holds
   only the digits; the words live in the HTML legend beside it, so they stay
   at their own size, reflow, and can be measured for contrast like any other
   text on the page.
   -------------------------------------------------------------------------- */
.checks {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: center;
}
.dgm .checks__svg {
  width: 100%;
  height: auto;
}
.checks__svg .wire {
  stroke: var(--border-strong);
  fill: none;
  stroke-width: 1.5;
}
.checks__svg .wire-fill {
  fill: var(--void-lift);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}
.checks__svg .pin {
  fill: var(--electric-500);
}
.checks__svg .pin-n {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  fill: var(--text-on-signal);
}
.checks__legend {
  display: grid;
  gap: var(--space-3);
}
.checks__item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: var(--space-3);
  align-items: baseline;
}
.checks__n {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--ls-mono-wide);
  color: var(--signal-text);
}
.checks__w {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-body);
  letter-spacing: -0.01em;
  color: var(--text-hi);
}
@media (max-width: 760px) {
  .checks {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------------------
   G5 (the pipeline)
   Three lanes, one per family, each through the same four steps. The point of
   the drawing is that the four steps do not change: what changes is what each
   family is looking for. The travelling dot is decorative and aria-hidden.
   -------------------------------------------------------------------------- */
.pipe {
  display: grid;
  gap: var(--space-5);
}
.pipe__lane {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
}
.pipe__name {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-mono-wide);
  color: var(--signal-text);
}
.pipe__track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}
.pipe__node {
  background: var(--surface-panel);
  outline: 1px solid var(--border-subtle);
  outline-offset: -1px;
  border-radius: 4px;
  padding: 9px 10px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: 0.03em;
  color: var(--text-lo);
}
.pipe__dot {
  position: absolute;
  left: 0;
  bottom: -9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--electric-500);
}
@media (max-width: 760px) {
  .pipe__lane {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }
  .pipe__track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   G6 (the sorting bins)
   Where every measured answer ends up. This is the one diagram that uses all
   three meanings at once, so it is also the clearest statement of the rule:
   verified is the institution's own blue, confused and invented are amber
   because they are wrong, outdated and omitted are grey because they are
   neither. The cards carry no text: counting them would imply a measurement.
   -------------------------------------------------------------------------- */
.bins {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: end;
}
.bin {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 118px;
  justify-content: flex-end;
}
.bin__card {
  height: 13px;
  border-radius: 3px;
  background: var(--surface-panel);
  outline: 1px solid var(--border-subtle);
  outline-offset: -1px;
}
.bin__mouth {
  border-top: 2px solid var(--border-strong);
  padding-top: var(--space-3);
  margin-top: 6px;
}
.bin__label {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: 0.04em;
  line-height: 1.35;
  color: var(--text-lo);
}
/* own */
.bin--ok .bin__card {
  background: var(--electric-500);
  outline-color: var(--electric-500);
}
.bin--ok .bin__mouth {
  border-top-color: var(--electric-500);
}
.bin--ok .bin__label {
  color: var(--text-hi);
}
/* wrong or confused */
.bin--bad .bin__card {
  outline-color: var(--amber-500);
}
.bin--bad .bin__mouth {
  border-top-color: var(--amber-500);
}
.bin--bad .bin__label {
  color: var(--warn-text);
}
@media (max-width: 760px) {
  .bins {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: start;
  }
  .bin {
    min-height: 0;
  }
}

/* --------------------------------------------------------------------------
   G8 (the eight weeks)
   The bar is split 2 : 4 : 2, which is the real shape of the eight weeks, so
   the widths match the table underneath rather than being drawn to taste.
   The cycle row below says the work does not end at week 8.
   -------------------------------------------------------------------------- */
.tl {
  display: grid;
  grid-template-columns: 2fr 4fr 2fr;
  gap: 3px;
}
.tl__seg {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.tl__bar {
  height: 8px;
  border-radius: 2px;
  background: var(--border-subtle);
  position: relative;
  overflow: hidden;
}
.tl__fill {
  position: absolute;
  inset: 0;
  background: var(--electric-500);
  transform-origin: left center;
}
.tl__wk {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--ls-mono-wide);
  color: var(--signal-text);
}
.tl__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-body);
  letter-spacing: -0.01em;
  line-height: var(--lh-body-tight);
  color: var(--text-hi);
}
.tl__cycle {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.tl__step {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-mono-wide);
  color: var(--text-lo);
}
/* Decorative separators, aria-hidden, so WCAG would exempt them. They still
   get the AA-safe blue: electric-500 measures 3.54:1 here and there is no
   reason to ship a glyph the eye has to work for. */
.tl__sep {
  color: var(--signal-text);
}
@media (max-width: 760px) {
  .tl {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
  }
}
