@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215, U+2248; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215, U+2248; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-ext-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-ext-600.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-arabic-arabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-arabic-arabic-600.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  --ink: #24306A;        /* prescription-stamp ink */
  --ink-deep: #19224D;
  --paper: #F6F7F9;
  --sheet: #FFFFFF;
  --text: #1C2233;
  --muted: #545D72;
  --line: #D8DCE4;
  --paid: #1E7356;       /* stamp green: money that is owed or settled */
  --expected: #8A5A10;   /* amber: expected, never owed */
  --expected-bg: #FBF3E4;
  --focus: #3D63DD;
  --measure: 68ch;
  --radius: 6px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 1.0625rem/1.6 "Plex", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}
[dir="rtl"] body { line-height: 1.8; }
img, svg { max-width: 100%; }
a { color: var(--ink); text-underline-offset: 0.18em; }
a:hover { color: var(--ink-deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-weight: 600; color: var(--ink-deep); margin: 0; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); line-height: 1.25; letter-spacing: -0.01em; }
h3 { font-size: 1.0625rem; line-height: 1.4; }
p { margin: 0 0 1em; }
.num, td { font-variant-numeric: tabular-nums; }

.wrap { width: min(100% - 32px, 1120px); margin-inline: auto; }
.narrow { max-width: var(--measure); margin-inline: 0; }
.skip { position: absolute; inset-inline-start: 16px; top: -48px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { top: 8px; }

/* Header */
.top { background: var(--sheet); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { font-weight: 600; font-size: 1.25rem; text-decoration: none; color: var(--ink-deep); letter-spacing: -0.01em; }
.brand span { color: var(--paid); }
.top-nav { display: flex; align-items: center; gap: 20px; margin-inline-start: auto; }
.top-nav a:not(.button) { text-decoration: none; color: var(--muted); }
.top-nav a:not(.button):hover { color: var(--ink); }
.langs { display: flex; gap: 4px; }
.langs a { text-decoration: none; color: var(--muted); padding: 4px 8px; border-radius: var(--radius); font-size: 0.9375rem; }
.langs a[aria-current="page"] { color: var(--ink-deep); background: var(--paper); font-weight: 600; }

.button {
  display: inline-block; background: var(--ink); color: #fff; text-decoration: none; font: inherit; font-weight: 600;
  padding: 12px 20px; border: 0; border-radius: var(--radius); cursor: pointer;
}
.button:hover { background: var(--ink-deep); color: #fff; }
.button-small { padding: 8px 14px; font-size: 0.9375rem; }
.link { font-weight: 600; }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.status { display: inline-block; color: var(--paid); background: #E6F2EC; padding: 4px 10px; border-radius: var(--radius); font-size: 0.9375rem; margin-bottom: 20px; }
h1 { font-size: clamp(2.125rem, 1.5rem + 2.8vw, 3.5rem); line-height: 1.1; letter-spacing: -0.02em; max-width: 14ch; }
[dir="rtl"] h1 { line-height: 1.35; letter-spacing: 0; max-width: 18ch; }
.lede { font-size: 1.1875rem; color: var(--muted); margin-top: 20px; max-width: 54ch; }
.hero-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 28px; }

/* The ledger: the one bold element of the page */
.ledger {
  margin: 0; background: var(--sheet); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(36, 48, 106, 0.35); padding: 24px; position: relative;
}
.ledger-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; color: var(--ink-deep); margin-bottom: 12px; }
.ledger-tag { font-weight: 400; font-size: 0.875rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1px 8px; white-space: nowrap; }
.ledger table { width: 100%; border-collapse: collapse; }
.ledger th { text-align: start; font-weight: 400; color: var(--muted); padding: 7px 0; }
.ledger td { text-align: end; padding: 7px 0; color: var(--text); }
[dir="rtl"] .ledger td { direction: ltr; text-align: left; }
.ledger .sum th, .ledger .sum td { border-top: 1px solid var(--line); color: var(--text); font-weight: 600; }
.ledger .owed th, .ledger .owed td { color: var(--paid); font-weight: 600; font-size: 1.125rem; border-top: 2px solid var(--paid); padding-top: 10px; }
.ledger-aside { margin-top: 18px; background: var(--expected-bg); border-inline-start: 3px solid var(--expected); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 14px; color: var(--expected); }
[dir="rtl"] .ledger-aside { border-radius: var(--radius) 0 0 var(--radius); }
.ledger-aside-row { display: flex; justify-content: space-between; gap: 12px; }
.ledger-aside-row .num { direction: ltr; white-space: nowrap; }
.ledger-aside p { margin: 4px 0 0; font-size: 0.9375rem; }
.ledger figcaption { margin-top: 16px; font-size: 0.875rem; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .ledger .owed td { animation: stamp 700ms 400ms both cubic-bezier(.2,.7,.2,1); }
  .ledger-aside { animation: settle 600ms 900ms both ease-out; }
}
@keyframes stamp { from { opacity: 0; transform: scale(1.25); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }

/* Sections */
.section { padding-block: clamp(48px, 7vw, 88px); border-top: 1px solid var(--line); }
.section-lede { color: var(--muted); max-width: var(--measure); margin-top: 12px; }
.features { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 40px; }
.features li { border-top: 2px solid var(--ink); padding-top: 14px; }
.features p, .steps p { color: var(--muted); margin: 6px 0 0; }

.switch { background: var(--ink-deep); color: #E7EAF4; border-top: 0; }
.switch h2 { color: #fff; }
.switch-inner { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; }
.switch p { max-width: var(--measure); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--ink); color: var(--ink); font-weight: 600; margin-bottom: 14px;
}

/* Demo form */
.demo { background: var(--sheet); }
.demo-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.demo-grid > div > p { color: var(--muted); max-width: 46ch; margin-top: 12px; }
.form-how { font-size: 0.9375rem; }
form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-weight: 600; font-size: 0.9375rem; color: var(--ink-deep); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--paper); border: 1px solid #B9C0CE; border-radius: var(--radius);
  padding: 10px 12px; width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
[aria-invalid="true"] { border-color: #B3261E; }
.hint { margin: 0; font-size: 0.875rem; color: var(--expected); }
.check { grid-template-columns: auto 1fr; align-items: start; gap: 10px; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ink); }
.check label { font-weight: 400; color: var(--text); }
.form-status { margin: 0; min-height: 1.6em; font-weight: 600; }
.form-status.error { color: #B3261E; }
.form-status.done { color: var(--paid); }
form .button { justify-self: start; }

.privacy p { color: var(--muted); }
.privacy h2 { margin-bottom: 12px; }

.foot { border-top: 1px solid var(--line); padding-block: 28px; font-size: 0.9375rem; color: var(--muted); }
.foot-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot p { margin: 0; }

.notfound { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 12px; }

@media (max-width: 900px) {
  .hero-grid, .demo-grid, .switch-inner { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 600px) {
  .top-nav a:not(.button) { display: none; }
  .top-inner { gap: 12px; padding-block: 10px; }
  .top-nav { margin-inline-start: auto; }
  .langs { width: 100%; }
  .features, .field-row { grid-template-columns: 1fr; }
  .ledger { padding: 18px; }
}
