/* KDC Pay marketing site. One stylesheet, system fonts, no external resources. */

:root {
  color-scheme: light dark;

  --paper: #fbfaf7;
  --raised: #ffffff;
  --sunk: #f3f1ea;
  --ink: #101216;
  --ink-2: #4d525c;
  --line: #e4e1d8;
  --line-2: #cfcbbf;
  --accent: #4a6fa5;
  --accent-ink: #2c4a78;
  --accent-wash: #e9eef6;

  --up: #1f8a5b;
  --up-ink: #17694a;
  --switch: #b7791f;
  --switch-ink: #855610;
  --down: #c0392b;
  --down-ink: #a52f23;
  --down-wash: #fbeeec;

  --solid-bg: #101216;
  --solid-fg: #fbfaf7;
  --panel-bg: #101216;
  --panel-fg: #eceef3;
  --panel-fg-2: #b3b9c6;
  --panel-line: #2a2e38;
  --code-bg: #14171d;
  --code-fg: #e6e9ef;
  --code-dim: #9aa3b2;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: 20px;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1115;
    --raised: #171a21;
    --sunk: #0b0d10;
    --ink: #eceef3;
    --ink-2: #a7aebb;
    --line: #262a33;
    --line-2: #394050;
    --accent: #8fb0e0;
    --accent-ink: #a9c3ea;
    --accent-wash: #18202d;

    --up: #3fbf88;
    --up-ink: #62d3a2;
    --switch: #e0a94a;
    --switch-ink: #e7b964;
    --down: #ee6f61;
    --down-ink: #f39a8f;
    --down-wash: #241615;

    --solid-bg: #eceef3;
    --solid-fg: #0f1115;
    --panel-bg: #171a21;
    --panel-line: #2c313c;
    --code-bg: #0b0d10;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono, code { font-family: var(--mono); font-size: 0.92em; }

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 30;
  padding: 10px 14px;
  background: var(--solid-bg);
  color: var(--solid-fg);
  border-radius: 6px;
  font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---- header ------------------------------------------------------------ */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.top-row {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-decoration: none;
}
.brand-mark { width: 32px; height: 32px; }
.brand-word { width: 110px; height: auto; }

@media (prefers-color-scheme: dark) {
  /* The mark is black and grey: give it the paper tile it was drawn for. */
  .brand-mark, .router-core img {
    background: #fbfaf7;
    border-radius: 7px;
    padding: 2px;
  }
}

.top-nav {
  display: none;
  margin-left: auto;
  gap: 2px;
}
.top-nav a {
  padding: 8px 10px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
}
.top-nav a:hover { color: var(--ink); background: var(--sunk); }

.top .btn { margin-left: auto; }

@media (min-width: 1000px) {
  .top-nav { display: flex; }
  .top .btn { margin-left: 8px; }
}

/* ---- buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn-small { min-height: 38px; padding: 0 16px; font-size: 0.9375rem; }
.btn-solid { background: var(--solid-bg); color: var(--solid-fg); }
.btn-solid:hover { background: var(--accent-ink); color: var(--paper); }
.btn-line { border-color: var(--line-2); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); }
.btn-invert { background: #fbfaf7; color: #101216; }
.btn-invert:hover { background: #dfe8f5; }
.btn-ghost { border-color: #4a5160; color: var(--panel-fg); }
.btn-ghost:hover { border-color: var(--panel-fg); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- hero -------------------------------------------------------------- */

.hero { padding-block: 48px 64px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.kicker {
  margin-bottom: 20px;
  color: var(--accent-ink);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.375rem, 1.5rem + 3.6vw, 3.75rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

/* The wordmark sets a heavy "KDC" against a calligraphic "pay": echo it once per heading. */
h1 em, .closing h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
  white-space: nowrap;
}

.lede {
  max-width: 34em;
  margin-top: 24px;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
}

.hero .actions { margin-top: 32px; }

.hero-foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
}

@media (min-width: 1000px) {
  .hero { padding-block: 80px 96px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
}

/* ---- routing diagram --------------------------------------------------- */

.router {
  padding: 14px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 0 var(--line), 0 24px 48px -32px rgba(16, 18, 22, 0.35);
}

.router-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) clamp(26px, 7vw, 64px) minmax(0, 1.2fr);
}

.router-in {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: stretch;
  gap: 14px;
}
/* The payment's path through KDC Pay: in at the top, answer out at the bottom. */
.router-in::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--line-2);
}

.chip {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.3;
  text-align: center;
}
.chip-top { align-self: start; }
.chip-bottom { align-self: end; }
.chip-k {
  color: var(--ink-2);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chip-v { font-size: 0.8125rem; font-weight: 650; font-variant-numeric: tabular-nums; }

.router-core {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: var(--raised);
  border: 2px solid var(--ink);
  border-radius: 12px;
  text-align: center;
  line-height: 1.25;
}
.router-core img { width: 40px; height: 40px; }
.core-name { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; }
.core-note { color: var(--ink-2); font-size: 0.75rem; }

.wires { width: 100%; height: 100%; overflow: visible; }

.wire {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.wire.is-target {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 2 9;
  animation: flow 0.9s linear infinite;
}
.wire.is-switching { stroke: var(--switch); }
.wire.is-forced { stroke: var(--switch); }
.wire.is-down {
  stroke: var(--down);
  stroke-dasharray: 1 7;
  opacity: 0.55;
}

@keyframes flow {
  from { stroke-dashoffset: 22; }
  to { stroke-dashoffset: 0; }
}

.router-gws {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
}
.router-gws li { display: flex; padding-block: 5px; min-height: 92px; }

.gw {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  background: var(--raised);
  border: 1.5px solid var(--line-2);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.gw:hover { border-color: var(--ink); }
.gw.is-target { border-color: var(--accent); background: var(--accent-wash); }
.gw.is-down { border-color: var(--down); border-style: dashed; background: var(--down-wash); }

.gw-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  column-gap: 8px;
}
.gw-name { font-size: 0.9375rem; font-weight: 750; letter-spacing: -0.01em; }
.gw-act {
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.gw-state {
  position: relative;
  padding-left: 16px;
  color: var(--up-ink);
  font-size: 0.8125rem;
  font-weight: 600;
}
.gw-state::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--up);
}
.gw.is-down .gw-state { color: var(--down-ink); }
.gw.is-down .gw-state::before { background: var(--down); border-radius: 2px; }

.router-route {
  min-height: 3.1em;
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--sunk);
  border-left: 3px solid var(--accent);
  border-radius: 4px 8px 8px 4px;
  font-size: 0.9375rem;
  font-weight: 550;
  line-height: 1.45;
}
.router.is-all-down .router-route { border-left-color: var(--switch); }

.router figcaption {
  margin-top: 10px;
  padding-inline: 2px;
  color: var(--ink-2);
  font-size: 0.8125rem;
  line-height: 1.45;
}

@media (min-width: 480px) {
  .router { padding: 22px; }
  .gw { padding: 12px 16px; }
  .chip { padding: 9px 12px; }
  .chip-v { font-size: 0.875rem; }
  .core-name { font-size: 1.125rem; }
}

/* On wide screens the diagram is the hero's second half, not a thumbnail. */
@media (min-width: 1000px) {
  .router { padding: 28px; }
  .router-gws li { min-height: 108px; padding-block: 7px; }
  .gw { padding: 14px 18px; gap: 8px; }
  .gw-name { font-size: 1.0625rem; }
  .gw-act { font-size: 0.8125rem; }
  .gw-state { font-size: 0.9375rem; padding-left: 18px; }
  .gw-state::before { top: 0.42em; }
  .router-core { padding: 20px 10px; }
  .router-core img { width: 48px; height: 48px; }
  .core-name { font-size: 1.25rem; }
  .core-note { font-size: 0.8125rem; }
  .router-route { margin-top: 16px; padding: 14px 16px; font-size: 1rem; }
}

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

.band { border-top: 1px solid var(--line); }
.band-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 64px; }

.band-head h2, .closing h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.625rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.band-head p { max-width: 30em; margin-top: 16px; color: var(--ink-2); }

h3 { font-size: 1.0625rem; font-weight: 750; line-height: 1.3; letter-spacing: -0.012em; }

.band-body > * + * { margin-top: 32px; }
.band-body p { color: var(--ink-2); }

@media (min-width: 1000px) {
  .band-grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 72px;
    padding-block: 104px;
  }
  .band-head { position: sticky; top: 100px; align-self: start; }
}

/* three things that stay yours */
.keeps { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.keeps li { padding-block: 20px; border-bottom: 1px solid var(--line); }
.keeps h3 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.025em; }
.keeps p { margin-top: 6px; }

@media (min-width: 640px) {
  .keeps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
  .keeps li { border-bottom: 0; padding-block: 20px 0; }
}

.today {
  padding: 20px 22px;
  background: var(--sunk);
  border-radius: var(--radius);
}
.today dt {
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.today dd { color: var(--ink-2); }
.today dd + dd { margin-top: 4px; }
.today strong { color: var(--ink); font-weight: 700; }

/* six methods */
.methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.methods li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.methods span { font-weight: 700; letter-spacing: -0.01em; }
.methods code { color: var(--ink-2); font-size: 0.8125rem; }

@media (min-width: 640px) {
  .methods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .methods li { padding: 20px; }
}

.pair, .quad { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) {
  .pair, .quad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card {
  padding: 22px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card h3 + p { margin-top: 8px; }
.card-tag {
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.band-body .card-tag { color: var(--accent-ink); }

.aside { padding-left: 16px; border-left: 2px solid var(--line-2); font-size: 0.9375rem; }

.quad { gap: 0 40px; }
.quad li { padding-block: 22px; border-top: 1px solid var(--line); }
.quad h3 + p { margin-top: 6px; }

/* breaker timeline */
.breaker { display: grid; gap: 0; }
.breaker li {
  position: relative;
  padding: 0 0 26px 34px;
}
.breaker li:last-child { padding-bottom: 0; }
.breaker li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--switch);
  box-shadow: 0 0 0 1.5px var(--switch);
  z-index: 1;
}
.breaker li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: -6px;
  width: 2px;
  background: var(--line-2);
}
.breaker li:last-child::after { display: none; }
.breaker .is-down::before { background: var(--down); box-shadow: 0 0 0 1.5px var(--down); }
.breaker .is-up::before { background: var(--up); box-shadow: 0 0 0 1.5px var(--up); }
.breaker h3 { font-size: 1.125rem; font-weight: 800; letter-spacing: -0.02em; }
.breaker p { margin-top: 4px; font-size: 0.9375rem; }

@media (min-width: 720px) {
  .breaker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .breaker li { padding: 34px 20px 0 0; }
  .breaker li::before { top: 0; }
  .breaker li::after { left: 12px; right: 0; top: 7px; bottom: auto; width: auto; height: 2px; }
}

/* ledger */
.ledger-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.facts li {
  padding-block: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}
.facts li:first-child { border-top: 2px solid var(--ink); }
.facts strong { color: var(--ink); font-weight: 750; }

.posting {
  align-self: start;
  padding: 20px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.posting table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.posting caption {
  padding-bottom: 12px;
  font-weight: 750;
  font-size: 0.9375rem;
  text-align: left;
}
.posting th, .posting td { padding: 8px 0; border-top: 1px solid var(--line); text-align: left; font-weight: 500; }
.posting thead th {
  border-top: 0;
  color: var(--ink-2);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.posting .num {
  padding-left: 12px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.posting tfoot th, .posting tfoot td { border-top: 2px solid var(--ink); font-weight: 750; }
.posting figcaption { margin-top: 12px; color: var(--ink-2); font-size: 0.8125rem; line-height: 1.45; }

@media (min-width: 760px) {
  .ledger-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 40px; }
}

/* code */
.code {
  background: var(--code-bg);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  color: var(--code-fg);
  overflow: hidden;
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  border-bottom: 1px solid var(--panel-line);
}
.code-title { color: var(--code-dim); font-size: 0.8125rem; font-weight: 600; }
.copy {
  min-width: 76px;
  min-height: 34px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid #454c5a;
  border-radius: 6px;
  color: var(--code-fg);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.copy:hover { border-color: var(--code-fg); }
.copy:focus-visible, .code pre:focus-visible { outline-color: #8fb0e0; }
.code pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.75;
  -webkit-overflow-scrolling: touch;
}
.code pre:focus-visible { outline-offset: -3px; }
.code code { font-size: inherit; }

@media (min-width: 640px) {
  .code pre { font-size: 0.875rem; padding: 22px; }
}

/* security */
.plain { border-top: 2px solid var(--ink); }
.plain > div { display: grid; gap: 4px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.plain dt { font-weight: 750; letter-spacing: -0.01em; }
.plain dd { color: var(--ink-2); }

@media (min-width: 640px) {
  .plain > div { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
}

/* ---- closing ----------------------------------------------------------- */

.closing { padding-block: 24px 72px; }
.closing-panel {
  padding: 40px 24px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-line);
  border-radius: 20px;
  color: var(--panel-fg);
}
.closing-panel img { width: 152px; height: auto; }
.closing h2 { max-width: 16em; margin-top: 28px; }
.closing p { max-width: 32em; margin-top: 14px; color: var(--panel-fg-2); }
.closing .actions { margin-top: 28px; }

@media (min-width: 760px) {
  .closing { padding-block: 40px 104px; }
  .closing-panel {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    padding: 64px;
  }
  .closing .actions { flex: none; margin-top: 0; }
}

/* ---- footer ------------------------------------------------------------ */

.foot { border-top: 1px solid var(--line); }
.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  padding-block: 24px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}
.foot-note { margin-right: auto; }
.foot a { font-weight: 600; }

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

.lost-page { display: grid; min-height: 100vh; min-height: 100dvh; }
.lost {
  align-self: center;
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding: 48px var(--gutter);
}
.lost-code {
  margin-top: 56px;
  color: var(--down-ink);
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 600;
}
.lost h1 { margin-top: 8px; font-size: clamp(2.25rem, 1.4rem + 4vw, 3.5rem); }
.lost .actions { margin-top: 32px; }

/* ---- motion ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wire.is-target { animation: none; }
  .gw { transition: none; }
}

[hidden] { display: none !important; }

/* Announced to screen readers, not drawn. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
