/* borrowbabe.com. One stylesheet, no dependencies, system fonts only.
   Tokens mirror the app's src/constants/theme.ts. */

:root {
  color-scheme: light;

  /* Brand coral. On white it reaches only 2.8:1, so it is used for fills and
     decoration, never as a text colour. Text on a coral fill is --ink (6.1:1). */
  --coral: #FF6B6B;
  /* theme.primaryDark: large display text only (3.5:1 on --bg). */
  --coral-dark: #E55555;
  /* Small text and links (5:1 on --bg, AA). */
  --coral-ink: #C23B3B;
  --coral-tint: #FFEFED;

  --ink: #1A1A2E;
  /* A step darker than theme.textSecondary so it stays AA on tinted panels too. */
  --muted: #5B6472;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --yellow: #FFE66D;
  --yellow-tint: #FFF7D1;
  --teal: #4ECDC4;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 36px;

  --shadow-card: 0 1px 2px rgba(26, 26, 46, 0.04), 0 10px 30px -12px rgba(26, 26, 46, 0.12);
  --wrap: 70rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section: clamp(4rem, 9vw, 7rem);
  --header-height: 4rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p,
ul,
ol {
  margin: 0;
}

a {
  color: var(--coral-ink);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--ink);
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
  color: #FFFFFF;
  outline-color: var(--coral);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 250, 250, 0.88);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
}

/* The wordmark is the logotype from the app's sign-in screen. */
.wordmark {
  color: var(--ink);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
  word-spacing: -0.12em;
}

.wordmark span {
  color: var(--coral);
}

.wordmark:hover {
  color: var(--ink);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--coral-tint);
}

.nav-wide {
  display: none;
}

@media (min-width: 44em) {
  .nav-wide {
    display: block;
  }
}

/* ---------- Shared pieces ---------- */

.kicker {
  margin-bottom: 0.85rem;
  color: var(--coral-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.lede {
  color: var(--muted);
  font-size: clamp(1.0625rem, 0.95rem + 0.6vw, 1.25rem);
  line-height: 1.55;
}

.lede strong {
  color: var(--ink);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.5rem;
  background: var(--coral);
  color: var(--ink);
  border-radius: var(--radius-lg);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: var(--coral-dark);
  color: var(--ink);
}

.text-link {
  color: var(--ink);
  font-weight: 600;
}

.text-link::after {
  content: " \2192";
}

.card {
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1875rem;
}

.card p {
  color: var(--muted);
  font-size: 1rem;
}

.card p + p {
  margin-top: 0.75rem;
}

.section {
  padding-block: var(--section) 0;
}

.section h2,
.closing h2 {
  max-width: 22ch;
  font-size: clamp(1.875rem, 1.3rem + 2.6vw, 2.875rem);
  font-weight: 800;
}

/* ---------- App Store state ---------- */

.store-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.35rem 0.75rem 1.1rem;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  /* A full pill on one line that still looks right if a narrow screen wraps it. */
  border-radius: 1.625rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
}

@media (max-width: 22.49em) {
  .store-soon {
    gap: 0.5rem;
    padding-inline: 0.85rem 1rem;
    font-size: 0.875rem;
  }
}

.store-soon-dot {
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.25);
}

.store-badge {
  display: inline-block;
  border-radius: var(--radius-md);
}

.store-badge img {
  height: 3.5rem;
  width: auto;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.hero-grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.375rem, 1.1rem + 5.9vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
  word-spacing: 0.06em;
}

.hero-accent {
  display: block;
  color: var(--coral-dark);
}

.hero .lede {
  max-width: 34rem;
  margin-top: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}

figure {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

figcaption {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: center;
}

/* The panel a phone sits on. */
.stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(2rem, 6vw, 3rem) 1.25rem;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  isolation: isolate;
}

.stage::before,
.stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
}

.stage-coral {
  background: var(--coral);
}

.stage-coral::before {
  width: 15rem;
  height: 15rem;
  top: -5rem;
  right: -4.5rem;
  background: var(--yellow);
}

.stage-coral::after {
  width: 19rem;
  height: 19rem;
  bottom: -8rem;
  left: -7rem;
  background: rgba(255, 255, 255, 0.22);
}

.stage-tint {
  background: var(--coral-tint);
}

.stage-tint::before {
  width: 13rem;
  height: 13rem;
  bottom: -4.5rem;
  right: -4rem;
  background: var(--coral);
}

.stage-tint::after {
  width: 6.5rem;
  height: 6.5rem;
  top: 2.25rem;
  left: 1.75rem;
  background: var(--yellow);
}

/* A phone drawn in CSS around a real screenshot (1206 x 2622). */
.phone {
  --phone-width: 240px;
  width: var(--phone-width);
  max-width: 100%;
  padding: calc(var(--phone-width) * 0.034);
  background: var(--ink);
  border-radius: calc(var(--phone-width) * 0.165);
  box-shadow:
    inset 0 0 0 2px #3B3B55,
    0 28px 50px -18px rgba(26, 26, 46, 0.55);
}

.phone img {
  width: 100%;
  height: auto;
  background: var(--bg);
  border-radius: calc(var(--phone-width) * 0.134);
}

@media (min-width: 60em) {
  .phone {
    --phone-width: 280px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}

/* ---------- How it works ---------- */

.steps,
.features {
  display: grid;
  gap: 1.25rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: 0;
  list-style: none;
}

@media (min-width: 44em) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 60em) {
  .steps,
  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.step-number {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1.25rem;
  background: var(--coral);
  border-radius: 50%;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 800;
}

.callout {
  margin-top: 1.25rem;
  padding: 1.15rem 1.5rem;
  background: var(--yellow-tint);
  border-radius: var(--radius-xl);
  color: var(--ink);
  font-size: 1rem;
}

/* ---------- For lenders ---------- */

.split {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.split-copy .lede {
  max-width: 32rem;
  margin-top: 1.25rem;
}

@media (min-width: 60em) {
  .split {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }
}

@media (max-width: 59.99em) {
  .split-copy {
    order: -1;
  }
}

.checks {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}

.checks li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  color: var(--muted);
  font-size: 1rem;
}

.checks strong {
  color: var(--ink);
}

.checks .icon {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.3rem;
  background: var(--coral);
  border-radius: 50%;
  color: var(--ink);
  stroke-width: 2.6;
}

/* ---------- Trust and safety ---------- */

.features .icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.25rem;
  padding: 0.7rem;
  background: var(--coral-tint);
  border-radius: var(--radius-lg);
  color: var(--coral-ink);
}

.card-quiet {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--border);
}

.card-quiet .icon {
  background: var(--yellow-tint);
  color: var(--ink);
}

.card a {
  font-weight: 600;
}

/* ---------- Closing ---------- */

.closing {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: clamp(2.75rem, 7vw, 5rem) clamp(1.25rem, 5vw, 4rem);
  background: var(--coral);
  border-radius: var(--radius-2xl);
  color: var(--ink);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.closing::before,
.closing::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
}

.closing::before {
  width: 16rem;
  height: 16rem;
  top: -8rem;
  left: -5rem;
  background: var(--yellow);
}

.closing::after {
  width: 20rem;
  height: 20rem;
  bottom: -12rem;
  right: -6rem;
  background: rgba(255, 255, 255, 0.22);
}

.closing-sub {
  font-size: 1.125rem;
  font-weight: 500;
}

.closing .store-soon,
.closing .button {
  margin-top: 0.75rem;
}

.closing .button {
  background: var(--ink);
  color: #FFFFFF;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: var(--section);
  padding-block: 3rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer-inner {
  display: grid;
  gap: 1.5rem;
}

.footer-brand p {
  margin-top: 0.35rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--ink);
  font-weight: 600;
}

.fineprint {
  font-size: 0.8125rem;
}

@media (min-width: 60em) {
  .site-footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .footer-contact,
  .fineprint {
    grid-column: 1 / -1;
  }

  .footer-contact {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
  }

  .fineprint {
    margin-top: -0.75rem;
  }
}

/* ---------- Documents: terms, privacy, guidelines, support ---------- */

.doc {
  padding-block: clamp(2rem, 5vw, 4rem) 0;
}

.doc-header h1 {
  font-size: clamp(2.125rem, 1.5rem + 3vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.doc-header,
.doc-body {
  max-width: 44rem;
}

.draft-banner {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--yellow-tint);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
}

.draft-banner-title {
  font-size: 1.0625rem;
  font-weight: 800;
}

mark.placeholder {
  padding: 0.05em 0.2em;
  background: var(--yellow);
  border-radius: 0.3em;
  color: var(--ink);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.toc {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.toc h2 {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.toc ul {
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.toc a {
  display: block;
  padding-block: 0.3rem;
  color: var(--ink);
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover {
  color: var(--coral-ink);
  text-decoration: underline;
}

@media (min-width: 34em) and (max-width: 63.99em) {
  .toc ul {
    columns: 2;
    column-gap: 2rem;
  }

  .toc li {
    break-inside: avoid;
  }
}

.doc-body {
  margin-top: 2rem;
}

.doc-body > * + * {
  margin-top: 1rem;
}

.doc-body h2 {
  margin-top: 2.75rem;
  font-size: 1.4375rem;
  font-weight: 800;
}

.doc-body h2 + * {
  margin-top: 0.85rem;
}

.doc-body .anchor {
  color: inherit;
  text-decoration: none;
}

.doc-body .anchor:hover {
  text-decoration: underline;
  text-decoration-color: var(--coral);
}

.doc-body ul,
.doc-body ol {
  padding-left: 1.35rem;
}

.doc-body li + li {
  margin-top: 0.4rem;
}

.doc-body li::marker {
  color: var(--coral-ink);
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.table-wrap th,
.table-wrap td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
}

.table-wrap thead th {
  background: var(--coral-tint);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-wrap tbody tr + tr {
  border-top: 1px solid var(--border);
}

.table-wrap tbody th {
  font-weight: 700;
}

.cell-label {
  display: none;
}

/* Side by side, give the explanatory last column the most room. */
@media (min-width: 44em) {
  .table-wrap table {
    table-layout: fixed;
  }

  .table-wrap th:first-child {
    width: 27%;
  }

  .table-wrap th:last-child {
    width: 43%;
  }
}

/* On a phone each table row becomes a small card: the first cell is its title and
   the rest are labelled with their column heading. */
@media (max-width: 43.99em) {
  .table-wrap {
    overflow: visible;
    background: none;
    border-radius: 0;
    box-shadow: none;
  }

  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
  }

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

  .table-wrap tbody tr {
    padding: 1rem 1.15rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
  }

  .table-wrap tbody tr + tr {
    margin-top: 0.75rem;
    border-top: 0;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 0;
  }

  .table-wrap td {
    margin-top: 0.65rem;
  }

  .table-wrap tbody th {
    font-size: 1rem;
  }

  .cell-label {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

/* Wide screens: the table of contents moves into a sticky side column. */
@media (min-width: 64em) {
  .doc-with-toc {
    display: grid;
    grid-template-columns: 15.5rem minmax(0, 44rem);
    column-gap: 4rem;
    justify-content: center;
  }

  .doc-with-toc .doc-header,
  .doc-with-toc .doc-body {
    grid-column: 2;
  }

  .doc-with-toc .toc {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    max-height: calc(100vh - var(--header-height) - 3rem);
    margin-top: 0.5rem;
    overflow-y: auto;
  }

  .doc:not(.doc-with-toc) .doc-header,
  .doc:not(.doc-with-toc) .doc-body {
    margin-inline: auto;
  }
}

/* ---------- 404 ---------- */

.notfound {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
  padding-block: clamp(4rem, 12vw, 8rem) 0;
}

.notfound h1 {
  font-size: clamp(2.125rem, 1.5rem + 3vw, 3.25rem);
  font-weight: 800;
}

.notfound .lede {
  max-width: 36rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  a,
  .button {
    transition: color 0.15s ease, background-color 0.15s ease;
  }

  .store-soon-dot {
    animation: pulse 2.4s ease-in-out infinite;
  }
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(255, 107, 107, 0);
  }
}

/* ---------- Print (people do print legal pages) ---------- */

@media print {
  .site-header,
  .site-footer nav,
  .skip-link,
  .toc {
    display: none;
  }

  body {
    background: #FFFFFF;
    font-size: 11pt;
  }

  .doc-body a {
    color: inherit;
  }
}
