/* MojaWallet, the public site - THE DOCUMENT LAYER.
 *
 * site.css is tokens, type, shell and components: on its own a complete,
 * AA-contrast, keyboard-usable site with every word visible. motion.css is
 * the designed surface, pulled in by the @import below so a page still links
 * ONE stylesheet and the motion layer cannot ship half-wired. Nothing here
 * starts hidden: every opening frame lives over there.
 *
 * Palette and typeface are docs/DESIGN.md literally, and they are the two
 * things that were wrong here - a system font stack and a retired accent.
 * The class contract and the reasoning are in docs/INTEGRATION-NOTES.md.
 */
@import url("motion.css");

/* Plus Jakarta Sans, SIL OFL (fonts/OFL.txt): one variable woff2, latin,
 * byte-identical to the wallet's. */
@font-face {
  font-family: 'Jakarta';
  src: url('fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  font-weight: 200 800; font-style: normal; font-display: swap;
}

@view-transition { navigation: auto; }

/* tokens */
/* test/a11y.test.ts reads the hex out of these two blocks and measures the
 * real ratio on every ground. Dark is the BASE as it is in web/app.css:
 * light is a choice a reader makes, never the face a stranger lands on. */
:root {
  color-scheme: dark;
  --font: 'Jakarta', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --bg: #0A0A0B;  --bg2: #0F0F11;  --card: #141417;  --card2: #1B1B20;
  --line: rgba(255,255,255,0.075); --line2: rgba(255,255,255,0.15);
  --tx: #FFFFFF;  --tx2: #9E9EA8;  --tx3: #84848E;
  --acc: #C6F24E; --acc-deep: #B2E02F; --on-acc: #0A0A0B;
  --acc-dim: rgba(198,242,78,0.12); --acc-glow: rgba(198,242,78,0.18);
  --acc-2: #7FA6FF;
  --up: #3FE08A;  --up-dim: rgba(63,224,138,0.13);
  --down: #FF6B6B; --down-dim: rgba(255,107,107,0.13);
  --warn: #FFC24D; --warn-dim: rgba(255,194,77,0.13);
  --ctl-line: #6E6E78; --focus-ring: #C6F24E;
  --ground: #0A0A0B; --canvas: #0F0F11;
  --glass: rgba(15,15,17,0.72); --glass-line: rgba(255,255,255,0.10);
  --scrim: rgba(0,0,0,0.66);
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.45);
  --shadow-lg: 0 2px 8px rgba(0,0,0,.5), 0 34px 70px -22px rgba(0,0,0,.8);
  --grain-o: 0.04;

  /* 96px ceiling, -0.04em tracking floor. Fluid type is these steps only. */
  --fs-display: clamp(2.75rem, 1.1rem + 7vw, 6rem);
  --fs-h1: clamp(2rem, 1.25rem + 3vw, 3.25rem);
  --fs-h2: clamp(1.55rem, 1.1rem + 1.9vw, 2.35rem);
  --fs-h3: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --fs-lede: clamp(1.0625rem, 0.98rem + 0.62vw, 1.3125rem);
  --fs-body: clamp(1rem, 0.97rem + 0.16vw, 1.0625rem);
  --track-display: -0.04em; --track-h1: -0.035em;
  --track-h2: -0.03em; --track-h3: -0.02em;
  --measure: 68ch;

  --r-ctl: 16px; --r-card: 18px; --r-tile: 24px; --r-pill: 999px;
  --r-canvas: clamp(22px, 2.6vw, 34px);
  --wrap: 1140px; --gut: clamp(12px, 2.6vw, 22px); --nav-h: 58px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --dur-1: .16s; --dur-2: .24s; --dur-3: .42s; --dur-4: .62s;
  --tr: var(--dur-1) var(--ease-out);
  --tr3: var(--dur-3) var(--ease-out);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FAFAF8;  --bg2: #F1F1EE;  --card: #FFFFFF;  --card2: #EEEEEA;
  --line: rgba(11,11,13,0.09); --line2: rgba(11,11,13,0.18);
  --tx: #0B0B0D;  --tx2: #55555F;  --tx3: #686872;
  --acc: #B2E02F; --acc-deep: #97C020; --on-acc: #0A0A0B;
  --acc-dim: rgba(120,160,20,0.14); --acc-glow: rgba(120,160,20,0.22);
  --acc-2: #2F5BD0;
  --up: #17794C;  --up-dim: rgba(23,121,76,0.10);
  --down: #C0392F; --down-dim: rgba(192,57,47,0.10);
  --warn: #8A5E12; --warn-dim: rgba(138,94,18,0.10);
  --ctl-line: #86868E; --focus-ring: #0B0B0D;
  --ground: #F1F1EE; --canvas: #FAFAF8;
  --glass: rgba(255,255,255,0.74); --glass-line: rgba(11,11,13,0.10);
  --scrim: rgba(11,11,13,0.40);
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --shadow-lg: 0 2px 6px rgba(16,24,40,.05), 0 28px 60px -18px rgba(16,24,40,.18);
  --grain-o: 0.028;
}

/* base */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* `hidden` must beat every display rule below it: `.contactrow a { display:
 * block }` beat the UA rule once and put four empty contact cards on a
 * deployment that had no support desk at all. */
[hidden] { display: none !important; }

/* NOTHING SCROLLS SIDEWAYS, and this ONE rule is what does it. `overflow-x:
 * hidden` on body never did - the non-visible overflow propagates to the
 * viewport and body computes back to visible - and once html carried `clip`
 * it propagated instead, so body's `hidden` was used as specified: `hidden
 * auto`, a scroll container that can never scroll. Sticky resolves against
 * the nearest scrollport, so the header, the nav strip and the pinned steps
 * were dead on all nine pages. Body carries no overflow. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

/* The safety net. Every animation in motion.css is ALSO written inside
 * `prefers-reduced-motion: no-preference`, so switching them off here can
 * never leave an element stuck at its opening frame. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  background: var(--ground); color: var(--tx);
  font-family: var(--font); font-size: var(--fs-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased; min-height: 100%;
}

/* Both languages are IN the page. These two rules may only ever HIDE:
 * `display: revert` on the visible half out-specified every author rule
 * below and laid English out differently from Swahili. */
:root:not([data-lang="en"]) body [lang="en"] {
  display: none;
}
:root[data-lang="en"] body [lang="sw"] {
  display: none;
}

a { color: inherit; text-decoration-color: var(--line2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 8px; }
img, svg, picture { max-width: 100%; display: block; }
img { height: auto; }

/* type */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.06; text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: var(--fs-h1); letter-spacing: var(--track-h1); }
h2 { font-size: var(--fs-h2); letter-spacing: var(--track-h2); line-height: 1.1; }
h3 { font-size: var(--fs-h3); letter-spacing: var(--track-h3); line-height: 1.24; }
h4 { font-size: .9375rem; letter-spacing: -.01em; line-height: 1.3; }
.display, .hero h1 { font-size: var(--fs-display); letter-spacing: var(--track-display); line-height: .96; font-weight: 800; }
p { text-wrap: pretty; max-width: var(--measure); }
sup { font-size: .62em; line-height: 0; font-weight: 600; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 3.2vw, 40px); }
.narrow { max-width: 760px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--tx2); }
.dim3 { color: var(--tx3); }
.up { color: var(--up); }
.warnc { color: var(--warn); }
.accent { color: var(--acc); }
.link { color: var(--acc-2); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.center p, .center .lede { margin-inline: auto; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tx3); margin-bottom: 14px; }
.lede { font-size: var(--fs-lede); line-height: 1.5; color: var(--tx2); max-width: 62ch; }
[id] { scroll-margin-top: calc(var(--nav-h) + 34px); }

/* shell */
.top { position: sticky; top: 0; z-index: 60; padding: clamp(8px, 1.4vw, 14px) var(--gut) 0; }
.topbar, .navrow {
  border: 1px solid var(--glass-line); border-radius: var(--r-pill);
  background: var(--glass); box-shadow: var(--shadow);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
}
.topbar { position: relative; display: flex; align-items: center; gap: 10px; height: var(--nav-h); padding: 0 8px 0 clamp(14px, 2vw, 20px); }
@media (max-width: 400px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 10px; row-gap: 8px; border-radius: 22px; }
  .topbar .brand { flex-basis: 100%; margin-right: 0; }
  [id] { scroll-margin-top: calc(var(--nav-h) + 68px); }
}
.brand { font-weight: 800; font-size: 1.0625rem; letter-spacing: -.035em; text-decoration: none; margin-right: auto; flex-shrink: 0; display: flex; align-items: center; gap: 9px; }
.brand .mark {
  width: 24px; height: 24px; border-radius: 8px;
  background: #0A0A0B; color: var(--acc);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(198,242,78,.2), 0 4px 14px -4px rgba(198,242,78,.35);
}
.navstrip { position: relative; z-index: 59; padding: 8px var(--gut) 0; }
@media (min-width: 760px) {
  .navstrip { position: sticky; top: calc(var(--nav-h) + clamp(8px, 1.4vw, 14px)); }
  [id] { scroll-margin-top: calc(var(--nav-h) + 84px); }
}
.navrow { display: flex; gap: 4px; padding: 5px 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.navrow::-webkit-scrollbar { display: none; }
.navrow a {
  flex: 0 0 auto; padding: 7px 14px; border-radius: var(--r-pill);
  font-size: .875rem; font-weight: 600; color: var(--tx2);
  text-decoration: none; white-space: nowrap;
  transition: color var(--tr), background var(--tr);
}
.navrow a:hover, .navrow a[aria-current="page"] { color: var(--tx); background: var(--acc-dim); }

/* THE CANVAS: the page on a rounded plane with the ground around it, the one
   move that stops a site reading as a document. `clip` and not `hidden`:
   `hidden` makes a scroll container and breaks every sticky inside it. */
main {
  display: block; position: relative; isolation: isolate;
  width: calc(100% - 2 * var(--gut)); max-width: 1560px;
  margin: clamp(10px, 1.6vw, 20px) auto 0;
  border: 1px solid var(--line); border-radius: var(--r-canvas);
  background: var(--canvas); overflow: clip;
}
section { padding: clamp(52px, 8.5vw, 120px) 0; border-top: 1px solid var(--line); position: relative; }
section:first-of-type { border-top: 0; }

/* controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 13px 26px; border-radius: var(--r-pill);
  font-size: .9375rem; font-weight: 700; letter-spacing: -.005em;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  font-family: inherit; text-align: center;
  transition: transform var(--tr), background var(--tr), border-color var(--tr), box-shadow var(--tr);
}
.btn-1 { background: var(--acc); color: var(--on-acc); box-shadow: 0 10px 30px -14px var(--acc-glow); }
.btn-1:hover { background: var(--acc-deep); box-shadow: 0 16px 40px -14px var(--acc-glow); }
.btn-2 { background: transparent; color: var(--tx); border-color: var(--ctl-line); }
.btn-2:hover { background: var(--acc-dim); border-color: var(--acc); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.tog { display: flex; border: 1px solid var(--ctl-line); border-radius: var(--r-pill); overflow: hidden; flex-shrink: 0; }
.tog button { font: inherit; font-size: .75rem; font-weight: 700; padding: 5px 11px; background: none; border: 0; color: var(--tx3); cursor: pointer; line-height: 1.5; transition: background var(--tr), color var(--tr); }
.tog button:hover { color: var(--tx); }
.tog button[aria-pressed="true"] { background: var(--acc); color: var(--on-acc); }
.tog button[aria-pressed="true"]:focus-visible { outline-color: var(--tx); }

/* blocks */
/* every raised surface: one edge, one ground, one radius - then only the
   differences */
.card, .panel, .tablewrap, details.q, .contactrow a, .contactrow div.ch, .note-plain {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-tile);
}
.card { border-radius: var(--r-card); padding: clamp(20px, 2.4vw, 28px); position: relative; }
.panel { background: var(--card2); padding: clamp(20px, 2.6vw, 32px); }
.grid, .grid-2, .grid-3, .contactrow, .footgrid { display: grid; gap: var(--gap, 16px); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--col, 260px)), 1fr)); }
.grid-2 { --col: 340px; }
.grid-3 { --col: 240px; }
.stack > * + * { margin-top: 16px; }
.mt { margin-top: 26px; }
.mt-s { margin-top: 11px; }
.mt-l { margin-top: 44px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }

/* table */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: .9375rem; }
caption { text-align: left; padding: 18px 20px 2px; font-size: .8125rem; color: var(--tx3); }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: var(--tx3); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--card2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 7px; border-radius: var(--r-pill); padding: 4px 12px; font-size: .75rem; font-weight: 700; letter-spacing: .01em; border: 1px solid var(--line2); color: var(--tx2); white-space: nowrap; }
/* state is never colour alone: the chip carries its own word, and the dot
   is a second, non-colour signal of the same thing */
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: 0 0 auto; }
.chip-live { color: var(--up); border-color: color-mix(in srgb, var(--up) 42%, transparent); background: var(--up-dim); }
.chip-cfg { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 42%, transparent); background: var(--warn-dim); }
.chip-no { color: var(--tx2); background: var(--card2); }
/* NOT a failure and it may never look like one: a dashed edge and a literal
   '?', the same pair the console uses */
.chip-unknown { color: var(--warn); background: none; border-style: dashed; border-color: color-mix(in srgb, var(--warn) 52%, transparent); }
.chip-unknown::before { content: "?"; width: auto; height: auto; background: none; border-radius: 0; font-size: .8125rem; line-height: 1; }

.note { border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-dim); border-radius: var(--r-tile); padding: 18px 20px; font-size: .9375rem; }
.note strong { color: var(--warn); }
.note-plain { border-color: var(--line2); background: var(--card2); padding: clamp(18px, 2.2vw, 26px); font-size: .9375rem; color: var(--tx2); position: relative; overflow: hidden; }
.note-plain::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--acc), transparent); }
.note-plain strong { color: var(--tx); }
.note-plain > * + * { margin-top: 10px; }

/* hero + art */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 80px); position: relative; }
.hero h1 { margin-bottom: 20px; }
.hero .lede { font-size: clamp(1.125rem, 1rem + .9vw, 1.4375rem); max-width: 58ch; }
@media (min-width: 940px) {
  .hero .wrap:has(.hero-art) {
    display: grid; align-items: center;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px);
  }
}
.hero-art, figure.art { margin: 0; min-width: 0; position: relative; }
.hero-art img, figure.art img { width: 100%; border-radius: var(--r-tile); }
@media (max-width: 939px) { .hero-art { margin-top: 32px; } }
figure.art figcaption { margin-top: 10px; font-size: .8125rem; color: var(--tx3); }

/* lists */
ol.steps { list-style: none; counter-reset: s; display: grid; gap: 16px; }
ol.steps > li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 15px; align-items: start; }
ol.steps > li::before {
  content: counter(s); width: 34px; height: 34px; border-radius: var(--r-pill);
  background: var(--acc-dim); border: 1px solid color-mix(in srgb, var(--acc) 34%, transparent);
  color: var(--acc); display: grid; place-items: center;
  font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
ul.ticks { list-style: none; display: grid; gap: 11px; }
ul.ticks > li { display: grid; grid-template-columns: 18px 1fr; gap: 11px; align-items: start; }
ul.ticks > li::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--acc); margin: 10px 0 0 5px; }

/* prose */
.prose { max-width: 760px; }
.prose h2 { margin: 46px 0 14px; }
.prose h3 { margin: 30px 0 10px; }
.prose p, .prose ul, .prose ol { margin-bottom: 14px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin-bottom: 6px; max-width: var(--measure); }
.prose > section { padding: 0; border: 0; }

/* faq */
details.q { overflow: hidden; transition: border-color var(--tr3), background var(--tr3); }
details.q + details.q { margin-top: 12px; }
details.q[open] { border-color: var(--line2); background: var(--card2); }
details.q > summary { cursor: pointer; padding: 18px 22px; font-weight: 600; font-size: 1.0625rem; list-style: none; display: flex; gap: 14px; align-items: baseline; }
details.q > summary::-webkit-details-marker { display: none; }
details.q > summary::after { content: "+"; margin-left: auto; color: var(--tx3); font-weight: 400; font-size: 1.375rem; line-height: 1; transition: transform var(--tr3), color var(--tr3); }
details.q[open] > summary::after { content: "\2212"; color: var(--acc); transform: rotate(180deg); }
details.q .a { padding: 0 22px 20px; color: var(--tx2); font-size: .9375rem; }
details.q .a > * + * { margin-top: 11px; }

/* contact */
.contactrow { --col: 240px; --gap: 14px; }
.contactrow a, .contactrow div.ch { display: block; padding: 20px; text-decoration: none; transition: border-color var(--tr3), background var(--tr3); }
.contactrow a:hover { border-color: var(--acc); background: var(--card2); }
.ch-k, .ch-v, .ch-s { display: block; }
.ch-k { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); font-weight: 700; }
.ch-v { font-size: 1.125rem; font-weight: 700; margin-top: 6px; word-break: break-word; }
.ch-s { font-size: .8125rem; color: var(--tx2); margin-top: 5px; }

/* footer */
footer { padding: clamp(44px, 6vw, 76px) var(--gut) clamp(28px, 4vw, 44px); font-size: .9375rem; color: var(--tx2); }
footer > .wrap { max-width: var(--wrap); }
.footgrid { --col: 180px; --gap: 30px; }
footer h4 { font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; color: var(--tx3); margin-bottom: 13px; }
footer ul { list-style: none; display: grid; gap: 9px; }
footer a { color: var(--tx2); text-decoration: none; transition: color var(--tr); }
footer a:hover { color: var(--acc); }
.foot-end { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--tx3); font-size: .8125rem; display: grid; gap: 9px; }

/* a11y */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--acc); color: var(--on-acc); padding: 12px 20px; border-radius: 0 0 14px 0; z-index: 100; font-weight: 700; }
.skip:focus { left: 0; }

/* 2.5.8. A thumb is ~9mm and the other hand is usually carrying something */
@media (pointer: coarse) {
  .tog button, .navrow a, .btn, .btn-1, .btn-2, details.q > summary { min-height: 44px; }
  .tog button { min-width: 44px; }
  .navrow a { display: flex; align-items: center; }
}

@supports (content-visibility: auto) {
  section.defer { content-visibility: auto; contain-intrinsic-size: auto 720px; }
}
