/* afreepay.com — one stylesheet for the six pages.
   Colours, type and radii come from the apps' design system (docs/DESIGN_SYSTEM.md):
   one canvas (navy), one typeface (Manrope), one accent (green) used only for the
   main action, money arriving and success. Text on green is always black. */

@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --navy: #002455;
  --surface: #0b3468;
  --surface-high: #17458a;
  --deep: #001330;
  --green: #12b24a;
  --light: #f8f9fa;
  --ink: #000000;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);
  --ghost: rgba(255, 255, 255, 0.55);
  --line: rgba(255, 255, 255, 0.2);
  --text-dark: #333333;
  --text-grey: #555555;
  --divider: #dddddd;
  --radius-card: 20px;
  --radius-button: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.5;
  background: var(--navy);
  color: var(--white);
}
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, figure { margin: 0; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.section { position: relative; overflow: hidden; }
.section > .wrap { position: relative; padding-top: 96px; padding-bottom: 96px; }
.section--tight > .wrap { padding-top: 72px; padding-bottom: 72px; }
.section--flush-bottom > .wrap { padding-bottom: 0; }
.section--after-light > .wrap { padding-top: 0; }
/* Two light sections in a row: no seam between them. */
.section--light + .section--light { margin-top: -1px; box-shadow: 0 -2px 0 var(--light); }
.section--navy { background: var(--navy); color: var(--white); }
.section--deep { background: var(--deep); color: var(--white); }
.section--green { background: var(--green); color: var(--ink); }
.section--light { background: var(--light); color: var(--text-dark); }
.stack { display: flex; flex-direction: column; gap: 40px; }
.stack--tight { gap: 24px; }
.stack--loose { gap: 64px; }
.split { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 56px; }
.split--top { align-items: flex-start; }
.split--bottom { align-items: flex-end; }
.col { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.col--narrow { flex-basis: 380px; }
.col--wide { flex-basis: 560px; }
.swoosh { position: absolute; width: 1100px; max-width: none; opacity: 0.07; pointer-events: none; }
.swoosh--left { right: -360px; bottom: -220px; width: 980px; opacity: 0.06; }
.swoosh--right { right: -260px; top: -120px; }

/* ---------- type ---------- */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.section--green .eyebrow { color: var(--ink); }
.section--light .eyebrow { color: var(--text-grey); }
.display { font-size: clamp(40px, 6vw, 84px); line-height: 1; font-weight: 700; letter-spacing: -0.04em; }
.display--xl { font-size: clamp(40px, 6.4vw, 92px); line-height: 0.98; max-width: 1000px; }
.hero--home .display--xl { font-size: clamp(38px, min(5.6vw, 10.4vh), 84px); }
.title { font-size: clamp(32px, 4.6vw, 64px); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; max-width: 820px; }
.section--light .title { color: var(--navy); }
.subtitle { font-size: clamp(28px, 3vw, 38px); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.lead { font-size: 19px; color: var(--muted); max-width: 560px; }
.section--green .lead { color: var(--ink); }

/* ---------- buttons, chips, tags ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 17px;
  padding: 17px 30px; border-radius: var(--radius-button); border: 1px solid transparent;
}
.btn__icon { flex: 0 0 auto; margin-right: 10px; vertical-align: -4px; }
.btn--primary { background: var(--green); color: var(--ink); }
.btn--ghost { color: var(--white); border-color: rgba(255, 255, 255, 0.35); }
.btn--ink { background: var(--ink); color: var(--white); }
.btn--small { font-size: 15px; padding: 13px 22px; }
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible, .door:focus-visible, a:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.section--light a:focus-visible, .section--green a:focus-visible { outline-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 20px; background: var(--surface); }
.chip--outline { font-size: 14px; font-weight: 500; padding: 9px 16px; background: none; border: 1px solid var(--line); }
.networks { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.networks .eyebrow { flex-basis: 100%; }
.network { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 22px; padding: 6px 18px 6px 6px; font-weight: 700; font-size: 16px; }
.section--green .network { background: var(--white); color: var(--ink); }
.network img { width: 40px; height: 40px; border-radius: 12px; background: var(--white); object-fit: cover; }
.proof { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; color: var(--muted); }
.proof li { display: flex; align-items: center; gap: 6px; }
.proof svg { color: var(--green); flex: 0 0 auto; }
.chips__label { font-size: 13px; color: var(--muted); margin-right: 4px; }
.soon {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 12px; vertical-align: middle;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid currentColor;
}

/* ---------- header and footer ---------- */
.header { background: var(--navy); }
.header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; font-size: 24px; }
.brand img { width: 52px; height: 30px; object-fit: contain; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.nav a:not(.btn) { text-decoration: none; font-size: 15px; padding: 12px 0; border-bottom: 2px solid transparent; }
.nav a:not(.btn):hover { border-bottom-color: var(--ghost); }
.nav a[aria-current="page"] { font-weight: 700; border-bottom-color: var(--white); }
.footer { background: var(--deep); color: var(--white); }
.footer__top { display: flex; flex-wrap: wrap; gap: 40px 56px; padding-top: 72px; padding-bottom: 48px; }
.footer__brand { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.footer__brand .brand { font-size: 22px; }
.footer__brand .brand img { width: 44px; height: 26px; }
.footer__brand p { font-size: 15px; color: var(--muted); max-width: 320px; }
.footer__networks { list-style: none; margin: 4px 0 0; padding: 0; display: flex; gap: 10px; }
.footer__networks img { display: block; width: 32px; height: 32px; border-radius: 9px; background: var(--white); }
.footer__col { flex: 0 0 auto; min-width: 150px; display: flex; flex-direction: column; }
.footer__col .eyebrow { margin-bottom: 10px; }
.footer__col a { font-size: 15px; padding: 11px 0; color: var(--muted); text-decoration: none; white-space: nowrap; }
.footer__col a:hover { color: var(--white); text-decoration: underline; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 32px; padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ---------- hero ---------- */
.hero > .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 56px; padding-top: 28px; padding-bottom: 88px; }
.hero__text { flex: 1.3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero__photo { flex: 1 1 400px; min-width: 0; position: relative; margin-bottom: 48px; }
.hero__photo > img { display: block; width: 100%; height: clamp(400px, min(46vw, 100vh - 250px), 640px); object-fit: cover; object-position: 22% 40%; border-radius: 28px; }
.hero__label { position: absolute; right: 16px; top: 16px; background: var(--white); color: var(--navy); font-size: 13px; font-weight: 700; padding: 9px 16px; border-radius: 20px; }
/* The phone is sized from the photo's height, so the pair keeps its proportions when the photo shrinks to fit the window. */
.hero__phone { position: absolute; left: clamp(-64px, -5vw, -8px); bottom: -48px; height: 82%; aspect-ratio: 1 / 2.13; }
.hero__phone .phone { box-shadow: 0 0 0 2px #8a94a3, 0 0 0 7px #0b0d11, 0 40px 80px rgba(0, 0, 0, 0.6); }
.hero__toast {
  position: absolute; left: 58%; top: 9%; white-space: nowrap; background: var(--green); color: var(--ink);
  border-radius: 20px; padding: 10px 16px 10px 12px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35); font-size: 13px; line-height: 1.25;
}
.hero__toast strong { display: block; font-size: 17px; letter-spacing: -0.01em; }
.received { background: var(--green); color: var(--ink); border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.received--badge { position: absolute; left: 16px; bottom: 16px; border-radius: 20px; padding: 12px 18px; }

/* ---------- three words band ---------- */
.band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 40px; padding-top: 40px; padding-bottom: 40px; font-size: clamp(30px, 4.8vw, 68px); line-height: 1; font-weight: 700; letter-spacing: -0.04em; }
.band span:nth-child(2) { color: var(--ghost); }

/* ---------- doors ---------- */
.doors { display: flex; flex-wrap: wrap; gap: 12px; }
.door {
  flex: 1 1 260px; text-align: left; cursor: pointer; border: 0; border-radius: var(--radius-card); padding: 22px 24px;
  background: var(--surface); color: var(--white); font: inherit; display: flex; flex-direction: column; gap: 4px;
}
.door strong { font-size: 20px; }
.door span { font-size: 14px; }
.door[aria-pressed="true"] { background: var(--green); color: var(--ink); }

/* ---------- numbered rows ---------- */
.rows { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.row { display: flex; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.row__num { flex: 0 0 64px; font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; color: var(--ghost); }
.row__body { display: flex; flex-direction: column; gap: 6px; }
.row__title { font-size: 22px; font-weight: 700; }
.row__body p { font-size: 15px; color: var(--muted); }
.section--green .rows, .section--green .row { border-color: var(--ink); border-width: 2px; }
.section--green .row__num, .section--green .row__body p { color: var(--ink); }
.section--light .rows, .section--light .row { border-color: var(--divider); border-width: 2px; }
.section--light .row__num { color: #757575; }
.section--light .row__title { color: var(--navy); }
.section--light .row__body p { color: var(--text-grey); }

/* ---------- cards and plain items ---------- */
.cards { display: flex; flex-wrap: wrap; gap: 16px; }
.card { flex: 1 1 320px; min-width: 0; background: var(--surface); border-radius: var(--radius-card); padding: 28px; display: flex; flex-direction: column; gap: 8px; }
.cards--narrow .card { flex-basis: 240px; }
.cards--column .card { flex-basis: 100%; }
.cards--two .card { flex-basis: 40%; min-width: 220px; }
.card__title { font-size: 22px; font-weight: 700; }
.card p { font-size: 15px; color: var(--muted); }
.plain { display: flex; flex-wrap: wrap; gap: 32px; }
.plain__item { flex: 1 1 240px; min-width: 0; border-top: 2px solid var(--line); padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.plain--wide .plain__item { flex-basis: 300px; }
.plain--column .plain__item { flex-basis: 100%; }
.plain__title { font-size: 19px; font-weight: 700; }
.plain__item p { font-size: 15px; color: var(--muted); }
.plain__item p a { display: block; padding: 4px 0; }
.section--green .plain__item { border-color: var(--ink); }
.section--green .plain__item p { color: var(--ink); }
.section--light .plain__item { border-color: var(--divider); }
.section--light .plain__title { color: var(--navy); }
.section--light .plain__item p { color: var(--text-grey); }
.pieces { display: flex; flex-wrap: wrap; gap: 32px; }
.pieces .plain__item { flex-basis: 280px; border-top-width: 1px; border-color: rgba(255, 255, 255, 0.25); padding-top: 20px; }
.pieces .plain__title { font-size: 22px; }

/* ---------- photos ---------- */
.photo { flex: 1 1 380px; min-width: 0; position: relative; }
.photo img { display: block; width: 100%; height: clamp(400px, 42vw, 580px); object-fit: cover; border-radius: 28px; }
.photo--short img { height: clamp(360px, 36vw, 480px); }
.photo--tall img { height: clamp(420px, 46vw, 640px); }
.photo--portrait { flex-basis: 340px; max-width: 480px; }
.photo--portrait img { height: auto; aspect-ratio: 4 / 5; }

/* ---------- story timeline (on green) ---------- */
.timeline { display: flex; flex-direction: column; border-bottom: 2px solid var(--ink); }
.timeline__row { display: flex; gap: 24px; padding: 18px 0; border-top: 2px solid var(--ink); }
.timeline__time { flex: 0 0 92px; font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.timeline__title { font-size: 17px; font-weight: 700; }
.timeline__row p { font-size: 15px; }
.story-title { font-size: clamp(36px, 5.2vw, 72px); line-height: 1; font-weight: 700; letter-spacing: -0.035em; }

/* ---------- devices ---------- */
.device { flex: 0 1 280px; min-width: 0; }
/* In a hero the device follows the window height, so it is never cut by the fold. */
.hero .device { flex-basis: clamp(190px, calc((100vh - 230px) / 2.13), 280px); }
.device--terminal { flex-basis: 300px; }
/* The terminal is taller than a phone for the same width (its printer and receipt). */
.hero .device--terminal { flex-basis: clamp(230px, calc((100vh - 400px) / 1.78), 280px); }
/* Every measure of the phone is a share of its width, so the frame keeps the
   same proportions at any size (a fixed radius turns a small phone into a pill
   and crops the corners of its screen). */
.phone {
  position: relative; background: #0e1014; border-radius: 15.5% / 7.2%; padding: 3.4%;
  box-shadow: 0 0 0 2px #4a515c, 0 0 0 5px #1a1d23, 0 36px 72px rgba(0, 0, 0, 0.5);
}
.phone > img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 20; object-fit: cover; border-radius: 13% / 5.9%; }
.phone::before, .phone::after { content: ""; position: absolute; right: -7px; width: 4px; background: #4a515c; border-radius: 0 3px 3px 0; }
.phone::before { top: 19%; height: 5.5%; }
.phone::after { top: 28%; height: 10.5%; }
.phone__cam { position: absolute; top: 3.1%; left: 50%; width: 4.4%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: #000000; box-shadow: 0 0 0 2px #1d2228; }
.terminal { padding-top: 124px; }
.terminal__body {
  position: relative; background: #20242c; border-radius: 26px 26px 36px 36px; padding: 0 16px 41px;
  box-shadow: 0 0 0 2px #4a515c, 0 36px 72px rgba(0, 0, 0, 0.5);
}
.terminal__body::before { content: ""; position: absolute; left: -7px; top: 48%; width: 5px; height: 48px; background: #4a515c; border-radius: 3px 0 0 3px; }
.terminal__body::after { content: "· · · · · ·"; position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; color: #0e1014; font-size: 18px; font-weight: 700; line-height: 1; }
.terminal__body > img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; }
.terminal__head { position: relative; height: 98px; margin: 0 -16px 16px; background: #2b303a; border-radius: 26px 26px 0 0; border-bottom: 3px solid #14171c; }
.terminal__head::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 50px; height: 12px; background: #8b929c; border-radius: 3px; border-top: 3px dotted #2b303a; }
.terminal__head::after { content: ""; position: absolute; right: 20px; bottom: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.receipt {
  position: absolute; left: 17%; right: 17%; bottom: 60px; height: 156px; background: var(--white); color: var(--ink);
  border-radius: 2px 2px 0 0; padding: 12px 10px 0; box-shadow: 0 -8px 18px rgba(0, 0, 0, 0.3);
  display: flex; flex-direction: column; align-items: center; gap: 5px; font-weight: 700; white-space: nowrap;
}
.receipt small { font-size: 9px; letter-spacing: 0.05em; }
.receipt strong { font-size: 13px; margin-top: 2px; }
.receipt i { display: block; height: 2px; border-radius: 1px; background: #b9bec6; width: 70%; }
.receipt i:nth-of-type(2) { width: 56%; }
.receipt i:nth-of-type(3) { width: 64%; }
.receipt i:nth-of-type(4) { width: 50%; }
.trio { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 40px; }
.trio figure { flex: 0 1 270px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.trio figcaption { display: flex; gap: 16px; min-height: 116px; }
/* Longer captions (the sign-up steps): one height, so the three phones stay on one line. */
.trio--steps figcaption { min-height: 150px; }
.trio__num { flex: 0 0 auto; font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; color: var(--ghost); }
.trio__text { display: flex; flex-direction: column; gap: 4px; }
.trio__text strong { font-size: 20px; }
.trio__text p { font-size: 15px; color: var(--muted); }

/* ---------- call to action box ---------- */
.cta { background: var(--navy); color: var(--white); border-radius: 28px; padding: clamp(28px, 5vw, 64px); display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: center; justify-content: space-between; }
.cta__text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
/* The quiet line under a closing box, for the other audience. */
.aside { margin-top: 24px; text-align: center; font-size: 15px; color: var(--text-grey); }
.aside a { color: var(--navy); font-weight: 700; }
.cta .title { color: var(--white); font-size: clamp(30px, 3.8vw, 50px); }

/* ---------- legal pages ---------- */
.legal { max-width: 800px; display: flex; flex-direction: column; gap: 20px; }
.legal .title { font-size: clamp(30px, 4vw, 48px); }
.legal__draft { background: #fff4d6; color: var(--text-dark); border-radius: 12px; padding: 14px 18px; font-size: 14px; }
.legal__meta { font-size: 14px; color: var(--text-grey); }
.legal__intro { font-size: 18px; color: var(--text-dark); }
.legal__clause { display: flex; flex-direction: column; gap: 8px; padding-top: 20px; border-top: 2px solid var(--divider); }
.legal__clause h2 { margin: 0; font-size: 19px; font-weight: 700; color: var(--navy); }
.legal__clause p { font-size: 16px; line-height: 1.6; color: var(--text-dark); }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  /* The header in two short rows: brand and sign-up button, then the five links on one line. */
  .header .wrap { position: relative; gap: 2px 16px; padding-top: 14px; padding-bottom: 4px; }
  .header .brand { font-size: 20px; gap: 10px; }
  .header .brand img { width: 44px; height: 26px; }
  /* The row runs 8px past the text column on each side: that is what lets five links fit a 360px screen. */
  .nav { flex: 1 1 100%; flex-wrap: nowrap; justify-content: space-between; gap: 0 6px; margin: 0 -8px; overflow-x: auto; }
  .nav a:not(.btn) { font-size: 13px; white-space: nowrap; }
  .nav .btn { position: absolute; right: 24px; top: 10px; font-size: 14px; padding: 8px 14px; }
  .footer__top { gap: 32px 24px; padding-top: 56px; }
  .footer__col { flex: 1 1 40%; min-width: 0; }
  .btn { font-size: 16px; padding: 15px 22px; }
  .btn__icon { width: 18px; height: 18px; margin-right: 8px; }
  /* In a closing box the buttons take the full width, so a label with its icon stays on one line. */
  .cta .actions { width: 100%; }
  .cta .btn { flex: 1 1 100%; text-align: center; font-size: 15px; padding: 15px 12px; }
  /* Three devices would stack into three screens of scrolling: swipe sideways instead. */
  .trio { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -24px; padding: 0 24px 16px; gap: 24px; }
  /* Keep the notification on the phone, clear of the face in the photo. */
  .hero__toast { left: 12%; top: -7%; }
  .band .wrap { flex-direction: column; gap: 4px; }
  .trio figure { flex: 0 0 230px; scroll-snap-align: center; }
  .trio figcaption { min-height: 156px; }
  .trio--steps figcaption { min-height: 160px; }
  .trio .terminal__body { padding-bottom: 26px; }
  .trio .terminal__body::after { bottom: 0; }
  .section > .wrap { padding-top: 72px; padding-bottom: 72px; }
  .section--flush-bottom > .wrap { padding-bottom: 0; }
}
