/* Right Business Loans — the rule-out sheet.
 *
 * Deep green on warm paper, a tick of sage, and a rail pinned to the foot of
 * the window carrying every page of the site. What it is recognisable by in
 * greyscale: a band across the bottom of every screen, and a front page whose
 * six rows each pair a picture with a sentence saying why not.
 *
 * Outfit over Archivo. The green is the logo's own #12372a and measures
 * 12.72:1 on this paper, so it carries text anywhere; the sage #adbc9f is
 * 1.95:1 and never does — it is for rules, ticks and the rail's divider.
 */

@font-face {
  font-family: "Outfit";
  src: url("display.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("text.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #fcfcf8;
  --tint: #f3f4e6;
  --green: #12372a;
  --green-deep: #0d2a20;
  --ink: #1c1d1a;
  --text: #2c2f2b;
  /* 6.86:1 on paper, 6.35:1 on --tint. */
  --muted: #555a54;
  /* 4.92:1 on paper. Nothing smaller than a caption takes this. */
  --faint: #6b7069;
  --rule: #e0e2d6;
  --rule-firm: #c2c6b6;
  /* 1.95:1: rules, ticks and dividers only. Never text, never a fill with
   * text on it. */
  --sage: #adbc9f;

  --shell: 1120px;
  --rail: 56px;
  --display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* Room for the rail, so it never covers the last thing on the page. */
  padding-bottom: var(--rail);
}

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 26px;
}

img {
  max-width: 100%;
}

a {
  color: var(--green);
}

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 60;
  background: var(--paper);
  padding: 10px 16px;
  border: 2px solid var(--green);
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- openers ---------- */

.open {
  padding: 48px 0 6px;
  max-width: 46rem;
}

.open__h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 1.25rem + 2.8vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 16px;
}

.open__stand {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
}

/* ---------- sections ---------- */

.sec {
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  margin-top: 30px;
}

.sec--ro {
  border-top: 0;
  margin-top: 20px;
}

.h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem);
  line-height: 1.18;
  color: var(--ink);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 22px;
  color: var(--muted);
  max-width: 45rem;
}

.aside {
  margin: 20px 0 0;
  font-size: 0.88rem;
  color: var(--faint);
  max-width: 45rem;
}

.prose {
  max-width: 40rem;
}

.prose p {
  margin: 0 0 16px;
}

/* ---------- the rule-out sheet ----------
 *
 * Six rows: the programme and its ceiling on the left, the picture and the
 * sentence saying why not on the right. A table because it is one -- six
 * rows on one column of judgement. */
.ro {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--green);
}

.ro th,
.ro td {
  text-align: left;
  vertical-align: top;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}

.ro th {
  width: 17rem;
  padding-right: 32px;
}

.ro th a {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--sage);
}

.ro th a:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}

.ro__figs {
  display: block;
  margin-top: 8px;
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.ro td p {
  margin: 0;
  color: var(--text);
  max-width: 38rem;
}

/* ---------- plates ----------
 *
 * Only ever beside something this site argues against, and only ever at that
 * argument's own measure. See photos.mjs. */
.plate {
  margin: 0 0 14px;
  max-width: 22rem;
}

.plate img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule-firm);
}

.plate figcaption {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--faint);
}

/* The standalone caveat sections: picture left, sentence right. */
.sec--against .h2 {
  margin-bottom: 18px;
}

.against {
  display: grid;
  grid-template-columns: 22rem minmax(0, 1fr);
  column-gap: 30px;
  align-items: start;
  border-top: 2px solid var(--green);
  padding-top: 20px;
}

.against .plate {
  margin: 0;
}

.against p {
  margin: 0;
  color: var(--text);
  max-width: 38rem;
}

/* ---------- the six in full ---------- */

.tbl__wrap {
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.tbl th,
.tbl td {
  text-align: left;
  padding: 13px 16px 13px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}

.tbl thead th {
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--rule-firm);
  padding-top: 0;
}

.tbl tbody th {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  white-space: nowrap;
}

.tbl tbody th a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--sage);
}

.tbl tbody th a:hover {
  color: var(--green);
}

.tbl td {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tbl tr.is-here {
  background: var(--tint);
}

/* ---------- a programme's own figures ---------- */

.figs {
  margin: 0 0 26px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--green);
  border-bottom: 1px solid var(--rule-firm);
}

.figs dt {
  grid-row: 1;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 14px 16px 4px 0;
}

.figs dd {
  grid-row: 2;
  margin: 0;
  padding: 0 16px 16px 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.14rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  border-top: 2px solid var(--green);
}

.steps li {
  counter-increment: step;
  padding: 20px 0 20px 3.4rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 20px;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--sage);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--green);
}

.steps h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  margin: 0 0 6px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}

/* ---------- the network's figures ---------- */

.net {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--green);
}

.net li {
  padding: 18px 20px 18px 0;
  border-bottom: 1px solid var(--rule);
}

.net strong {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.net span {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ---------- marks and questions ---------- */

.marks {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 42rem;
}

.marks li {
  padding: 10px 0 10px 28px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  color: var(--text);
}

/* A tick, which is this brand's mark. */
.marks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.95em;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
}

.qa {
  margin: 0;
  border-top: 2px solid var(--green);
}

.qa dt {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.06rem;
  color: var(--ink);
  padding: 16px 0 4px;
}

.qa dd {
  margin: 0;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  max-width: 42rem;
}

/* ---------- the application ---------- */

.sec--apply {
  background: var(--tint);
  border-top: 2px solid var(--green);
  margin-top: 34px;
  padding: 32px 26px;
}

.frame {
  margin-top: 20px;
  background: var(--paper);
  border: 1px solid var(--rule-firm);
}

.frame iframe {
  display: block;
  width: 100%;
  border: 0;
}

/* ---------- narrower ---------- */

@media (max-width: 900px) {
  /* THE RAIL STOPS BEING PINNED. A fixed bar carrying eleven links eats a
   * third of a phone, and a navigation that covers the thing it is
   * navigating is worse than one you have to scroll to. It sits under the
   * masthead as an ordinary band instead, and wraps. */
  .rail {
    position: static;
    height: auto;
    padding: 10px 0;
  }

  .rail__inner {
    flex-wrap: wrap;
    gap: 8px 18px;
    overflow-x: visible;
  }

  .rail__set {
    flex-wrap: wrap;
    gap: 4px 16px;
    white-space: normal;
  }

  .rail__set--rest {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid rgba(173, 188, 159, 0.4);
    padding-top: 8px;
    width: 100%;
  }

  body {
    padding-bottom: 0;
  }

  .ro th,
  .ro td {
    display: block;
    width: auto;
    padding-right: 0;
  }

  .ro th {
    padding: 22px 0 10px;
    border-bottom: 0;
  }

  .ro td {
    padding-top: 0;
  }

  .against {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 16px;
  }

  .against .plate {
    max-width: 22rem;
  }

  .net {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .figs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .figs dt:nth-of-type(3),
  .figs dt:nth-of-type(4) {
    grid-row: 3;
  }

  .figs dd:nth-of-type(3),
  .figs dd:nth-of-type(4) {
    grid-row: 4;
  }

  .net {
    grid-template-columns: minmax(0, 1fr);
  }

  .sec--apply {
    padding: 28px 16px;
    margin-left: -26px;
    margin-right: -26px;
  }
}

/* ---- the shared chrome, painted in this brand's colours ---- */
/* Chosen by measurement, not by name -- see tools/sitegen/chrome.css for what
 * each token does. Every pair below clears WCAG AA. Override freely. */
:root {
  --nav-bg: #fcfcf8;
  --nav-ink: #1c1d1a;
  --nav-ink-soft: #6b7069;
  --nav-rule: #d4d4d0;
  --nav-hover: #12372a;
  --nav-panel: #fefefc;
  --nav-cta-bg: #12372a;
  --nav-cta-ink: #ffffff;
  --nav-font: var(--display);

  --foot-bg: #1b211c;
  --foot-ink: #a4a6a4;
  --foot-head: #dddede;
  --foot-rule: #484d4a;
  --foot-link: #ecedec;
}
