/* Top Source Funding.
 *
 * On the ADR-0011 skeleton -- `tools/sitegen/page.css` is the layout. What is
 * here is the palette, the two typefaces, and the amounts.
 *
 * SORA OVER OUTFIT, teal on white with a sand tint. The logo's sun (#e8a33d)
 * is 2.2:1 on white, so it is the accent on the dark application band and
 * the rule over each amount, and never type on paper.
 */

@font-face {
  font-family: "Sora";
  src: url("display.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("text.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --ink: #0f2e31;
  --ink-soft: #0a2426;
  --text: #294446;
  --muted: #587274;

  --accent: #0e6f72;
  --accent-deep: #0a5457;
  --accent-wash: #e2f0ef;
  --accent-line: #b5d7d5;

  --good: #0e6f72;
  --good-wash: #dcecea;
  --warn: #8a5a12;

  --paper: #ffffff;
  --card: #ffffff;
  --tint: #f6f1e7;
  --rule: #e4dccb;
  --rule-firm: #d0c4ab;

  --ask-ink: #9fb6b7;
  --ask-accent: #e8a33d;

  --shadow: 15, 46, 49;

  --display: "Sora", system-ui, sans-serif;
  --body: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --display-weight: 700;
  --display-track: -0.02em;

  --shell: 1180px;
  --radius: 16px;
  --radius-sm: 10px;
}

/* ------------------------------------------------------------------ *
 * THE AMOUNTS -- the one band this site has and the skeleton does not.
 *
 * "How much do you need?" is this brand's first question, and it answers it
 * with three bands of amount rather than six products: an owner knows the
 * number before they know the instrument. Each band is a photograph, the
 * range in the display face over a sun-coloured rule, and what money of
 * that size is usually for.
 * ------------------------------------------------------------------ */
.amounts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.amounts li {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.amounts img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.amounts__say {
  padding: 22px 24px 26px;
  container-type: inline-size;
}

.amounts__fig {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  /* One line in every card, so the three rules under the figures line up. */
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  /* Sized to the card, not the window: the longest figure is about 13em. */
  font-size: min(1.9rem, 7.2cqi);
  white-space: nowrap;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 3px solid #e8a33d;
}

.amounts__say p {
  margin: 0;
  color: var(--text);
}

@media (max-width: 900px) {
  .amounts {
    grid-template-columns: 1fr;
  }
}

/* ---- the shared chrome, painted in this brand's colours ---- */
:root {
  --nav-bg: #ffffff;
  --nav-ink: #0f2e31;
  --nav-ink-soft: #587274;
  --nav-rule: #e4dccb;
  --nav-hover: #0e6f72;
  --nav-panel: #ffffff;
  --nav-cta-bg: #0e6f72;
  --nav-cta-ink: #ffffff;
  --nav-font: var(--display);
  --nav-size: 0.9375rem;
  --nav-weight: 600;
  --nav-track: 0;
  --nav-case: none;

  --foot-bg: #0f373a;
  --foot-ink: #9fafb0;
  --foot-head: #f6f7f7;
  --foot-rule: #2c5053;
  --foot-link: #fcfcfc;
}

/* The front door and the application page open with the form, and on a
   phone the form comes first: arrive, choose an amount, continue. The
   head's full top padding put a band of empty teal between the navbar and
   the first question, so it is taken in here. */
@media (max-width: 760px) {
  .head--form {
    padding-top: 18px;
  }
  .head--form .frame {
    padding: 6px;
  }
}

/* The legal pages: numbered heads inside the prose, set smaller than a
   band's h2 so a long document reads as one document. */
.legal h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--ink);
  margin: 2em 0 0.5em;
}
.legal ul {
  padding-left: 1.2em;
}
.legal li {
  margin-bottom: 0.5em;
}

/* ------------------------------------------------------------------ *
 * THE CHAT: the corner bubble, the teaser and the panel. The chat itself
 * is topsourcechat.php on the forms server, in the panel's frame.
 * ------------------------------------------------------------------ */
.tchat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  font-family: var(--body);
}
.tchat--tucked .tchat__btn,
.tchat--tucked .tchat__teaser {
  display: none;
}
.tchat__btn {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(var(--shadow), 0.28);
  margin-left: auto;
  transition: transform 0.15s, background 0.15s;
}
.tchat__btn:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}
.tchat__btn:focus-visible {
  outline: 3px solid var(--ask-accent);
  outline-offset: 3px;
}
.tchat__btn svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}
.tchat__dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ask-accent);
  border: 2px solid #fff;
}
.tchat--open .tchat__dot {
  display: none;
}
.tchat__teaser {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 300px;
  padding: 16px 16px 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(var(--shadow), 0.18);
  animation: tchat-in 0.25s ease-out;
}
.tchat__teaser[hidden] {
  display: none;
}
@keyframes tchat-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tchat__teaser { animation: none; }
}
.tchat__x {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
}
.tchat__x:hover {
  background: var(--tint);
}
.tchat__hello {
  display: flex;
  gap: 10px;
  margin: 0 18px 12px 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
}
.tchat__hello b {
  display: block;
  color: var(--ink);
}
.tchat__av {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tchat__quick {
  display: grid;
  gap: 8px;
}
.tchat__quick button {
  min-height: 42px;
  border-radius: 21px;
  border: 1.5px solid var(--accent);
  background: var(--card);
  color: var(--accent-deep);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tchat__quick button:hover {
  background: var(--accent-wash);
}
.tchat__quick button:focus-visible {
  outline: 3px solid var(--ask-accent);
  outline-offset: 2px;
}
.tchat__panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 390px;
  height: min(640px, calc(100vh - 110px));
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 24px 60px rgba(var(--shadow), 0.3);
}
.tchat__panel[hidden] {
  display: none;
}
.tchat__panel iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
@media (max-width: 700px) {
  .tchat {
    right: 16px;
    bottom: 16px;
  }
  .tchat__teaser {
    width: calc(100vw - 32px);
    max-width: 340px;
  }
  /* On a phone the chat takes the screen, as a messaging app does. */
  .tchat--open {
    inset: 0;
  }
  .tchat--open .tchat__btn {
    display: none;
  }
  .tchat__panel {
    position: fixed;
    inset: 0;
    width: auto;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
  }
  html.tchat-lock,
  html.tchat-lock body {
    overflow: hidden;
  }
}

/* The three short claims under the amounts band's heading, in one centred
   row rather than the grid ticks take elsewhere. */
.mid__ticks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin: -40px auto 56px;
}

/* Why Top Source: four cards, an icon on each. */
.why {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.why li {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.why__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(232, 163, 61, 0.16);
  color: var(--ask-accent);
  margin-bottom: 18px;
}
.why .h3 {
  margin: 0 0 8px;
}
.why .h3 {
  color: var(--card);
}
.why p {
  margin: 0;
  color: var(--ask-ink);
}
@media (max-width: 560px) {
  .why { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- Why Top Source: the dark split band ---------- */
.whyband {
  background: var(--ink);
  padding: var(--band) 0;
}
.whyband__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--gap);
  align-items: center;
}
.whyband .h2 {
  color: var(--card);
}
.whyband .lede {
  color: var(--ask-ink);
}
.whyband .eyebrow {
  color: var(--ask-accent);
}
.whyband .eyebrow::before {
  background: var(--ask-accent);
}
@media (max-width: 980px) {
  .whyband__grid { grid-template-columns: 1fr; }
}

/* ---------- The home page's steps, as one joined line of three ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 32px;
  left: 16%;
  right: 16%;
  border-top: 2px dashed var(--accent-line);
}
.timeline li {
  position: relative;
  text-align: center;
}
.timeline__n {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--card);
  box-shadow: 0 0 0 8px var(--accent-wash);
}
.timeline__k {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.timeline .h3 {
  margin: 0 0 10px;
}
.timeline li > p:last-child {
  margin: 0 auto;
  max-width: 34ch;
  color: var(--text);
}
.timeline__more {
  text-align: center;
  margin: 48px 0 0;
  font-weight: 600;
}
.timeline__more a {
  color: var(--accent);
}
@media (max-width: 760px) {
  .timeline { grid-template-columns: 1fr; gap: 36px; }
  .timeline::before { display: none; }
}

/* ---------- About: the values, four cards, each with its number ---------- */
.values {
  list-style: none;
  counter-reset: v;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.values li {
  counter-increment: v;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.values li::before {
  content: "0" counter(v);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 18px;
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
}
.values .h3 {
  margin: 0 0 8px;
}
.values p {
  margin: 0;
  color: var(--text);
}
.values__who {
  text-align: center;
  margin: 40px auto 0;
  max-width: 60ch;
}
@media (max-width: 900px) {
  .values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .values { grid-template-columns: 1fr; gap: 14px; }
}

/* ---------- About: who we are, as three short lines with icons ---------- */
.offer {
  list-style: none;
  margin: 28px 0 32px;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.offer li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.offer__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-wash);
  color: var(--accent);
}
.offer b {
  display: block;
  color: var(--ink);
  font-weight: 700;
}
.offer li > span:last-child {
  color: var(--text);
}

/* About's who-we-are: the words one side, the three lines the other. */
.who {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
.who .offer {
  margin: 0;
  order: -1; /* the list left, the words right: the hero above is words left */
}
@media (max-width: 900px) {
  .who { grid-template-columns: 1fr; gap: 32px; }
  .who .offer { order: 0; }
}

/* ---------- A product page's second band: is it right for you ---------- */
.fit {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--gap);
  align-items: center;
}
.fit .lede {
  margin-bottom: 28px;
}
.fit__k {
  margin: 0 0 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.fit .ticks {
  margin: 0;
  grid-template-columns: 1fr;
}
.fit__card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 32px 32px 16px;
  box-shadow: 0 18px 40px -28px rgba(15, 46, 49, 0.35);
}
.fit__card .offer {
  margin: 0;
  border-top: 0;
}
.fit__card .offer li:last-child {
  border-bottom: 0;
}
@media (max-width: 900px) {
  .fit { grid-template-columns: 1fr; gap: 36px; }
  .fit__card { padding: 24px 22px 8px; }
}

/* ---------- A product page's head: its figures as one tidy list ---------- */
.head__figs {
  grid-template-columns: 1fr;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 4px 22px;
}
.head__figs div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.head__figs div:first-child {
  border-top: 0;
}
.head__figs dt {
  margin: 0;
}
.head__figs dd {
  text-align: right;
}


/* ---------- A product page's how it works: photograph left, steps right ---------- */
.how {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
.how .h2 {
  margin-bottom: 28px;
}
.how__steps {
  list-style: none;
  counter-reset: h;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}
.how__steps li {
  counter-increment: h;
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 16px;
  align-items: start;
}
.how__steps li::before {
  content: counter(h);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--card);
  font-family: var(--display);
  font-weight: 700;
}
.how__steps b {
  display: block;
  color: var(--ink);
  font-weight: 700;
  margin: 2px 0 2px;
}
.how__steps span {
  color: var(--text);
}
@media (max-width: 900px) {
  .how { grid-template-columns: 1fr; gap: 32px; }
}

/* How it works' tags: two short facts per step, as pills. */
.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags li {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Why Top Source on a light ground, where a dark band follows it. */
.whyband--light {
  background: var(--tint);
}
.whyband--light .h2,
.whyband--light .why .h3 {
  color: var(--ink);
}
.whyband--light .lede,
.whyband--light .why p {
  color: var(--text);
}
.whyband--light .eyebrow {
  color: var(--accent);
}
.whyband--light .eyebrow::before {
  background: var(--accent);
}
.whyband--light .why li {
  background: var(--card);
  border-color: var(--rule);
}
.whyband--light .why__icon {
  background: var(--accent-wash);
  color: var(--accent);
}

/* How it works: three step cards, the last one filled. No arrows between
   them: the step labels and the filled last card already give the order. */
.journey {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  counter-reset: j;
}
.journey > li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px 28px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.journey__n {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.journey .h3 {
  margin: 0;
}
.journey > li > p {
  margin: 0 0 6px;
  color: var(--text);
  flex: 1;
}
.journey--end {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}
.journey--end .journey__n {
  color: var(--ask-accent);
}
.journey--end .h3 {
  color: var(--card);
}
.journey--end > p {
  color: #e0eeed !important;
}
.journey--end .tags li {
  background: rgba(255, 255, 255, 0.16);
  color: var(--card);
}
@media (max-width: 900px) {
  .journey { grid-template-columns: 1fr; gap: 16px; }
}

/* The network figures closing the dark Why band: no white card, a rule
   above and the figures in the band's own colours. */
.whyband__figs {
  margin-top: calc(var(--gap) * 1.1);
  padding-top: calc(var(--gap) * 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.whyband__figs .figures {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.whyband__figs .figures > div {
  padding: 8px 24px;
  border-left-color: rgba(255, 255, 255, 0.14);
}
.whyband__figs .figures b {
  color: var(--ask-accent);
  font-size: clamp(2rem, 1.4rem + 1.8vw, 2.8rem);
}
.whyband__figs .figures span {
  color: var(--ask-ink);
}
@media (max-width: 1000px) {
  .whyband__figs .figures > div {
    border: 0 !important;
    padding: 14px 0;
  }
}

/* The home page's ending: a card showing the form's first question. */
.ask .shot {
  margin-top: 32px;
}
.jump {
  padding: 26px 26px 18px;
}
.jump__q {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}
.jump__sub {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--muted);
}
.jump__opt {
  display: block;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--rule-firm);
  border-radius: 10px;
  text-decoration: none;
}
.jump__opt:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
}
.jump__opt b {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink);
}
.jump__opt span {
  font-size: 0.85rem;
  color: var(--muted);
}
.jump__go {
  display: block;
  margin-top: 6px;
  padding: 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--card);
  text-align: center;
  font-weight: 700;
  text-decoration: none;
}
.jump__go:hover {
  background: var(--accent-deep);
}
.jump__note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

/* The figures, when the Why band is the light one. */
.whyband--light .whyband__figs {
  border-top-color: var(--rule-firm);
}
.whyband--light .whyband__figs .figures > div {
  border-left-color: var(--rule-firm);
}
.whyband--light .whyband__figs .figures b {
  color: var(--accent);
}
.whyband--light .whyband__figs .figures span {
  color: var(--muted);
}
