/* SenFlote Maps — the public pages, on the same tokens as the explorer and the console (tokens.css is synced from
   packages/ui-tokens by scripts/sync-site-assets.sh). SenFlote Go's frontend V7 look: paper and ink, Plus Jakarta Sans and
   JetBrains Mono, mono eyebrow labels, 16 px cards, the Maps green as the brand. */

@font-face {
  font-family: 'Plus Jakarta Sans Variable';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2');
}

:root {
  --max: 56rem;
}

html {
  scroll-behavior: smooth;
}
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.65;
}
a {
  color: var(--brand-ink);
  text-underline-offset: 3px;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ── Header: lockup, nav, theme ──────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 72rem;
  min-height: 60px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex: none;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, #12b37a, #0a7d55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 2px 8px color-mix(in srgb, #0a7d55 35%, transparent);
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand__name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand__name b {
  color: var(--brand);
  font-weight: 800;
}
.brand__sub {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  word-spacing: normal;
}
.nav {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 2px 4px;
}
.nav a {
  padding: 6px 11px;
  border-radius: 8px;
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.nav a:hover {
  background: var(--surface-2);
}
.nav a[aria-current='page'] {
  background: var(--brand-dim);
  color: var(--brand-ink);
}
/* The one call to action in the nav: the explorer. */
.nav .nav__cta {
  margin: 0 4px;
  background: var(--brand);
  color: var(--on-brand);
}
.nav .nav__cta:hover {
  background: var(--brand-2);
}
.theme-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--fg-2);
  cursor: pointer;
}
.theme-btn:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}
.theme-btn .icon--sun {
  display: none;
}
:root[data-theme='dark'] .theme-btn .icon--sun {
  display: block;
}
:root[data-theme='dark'] .theme-btn .icon--moon {
  display: none;
}

/* Language switch: FR / EN / AR, each link tagged with its own language. */
.lang {
  display: inline-flex;
  flex: none;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.lang a {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 30px;
  padding: 0 6px;
  border-radius: 5px;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.lang a:hover {
  background: var(--surface-3);
}
.lang a[aria-current='true'] {
  background: var(--brand);
  color: var(--on-brand);
}

/* Right to left (Arabic pages): code and technical strings keep their own order. */
pre,
code,
.stat__value:not(.stat__value--text),
.footer-bottom .mono {
  direction: ltr;
  unicode-bidi: isolate;
}
pre {
  text-align: left;
}
:root[dir='rtl'] .brand__name {
  direction: ltr;
}
/* A table of code: the first column of an Arabic page stays readable, the code cells stay left to right. */
:root[dir='rtl'] td code {
  display: inline-block;
}

/* ── Content ─────────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
}
.main h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
}
.main h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 0.6rem;
}
.main h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.4rem;
}
.main p {
  margin: 0 0 1rem;
  color: var(--fg-2);
}
.main strong {
  color: var(--fg);
}
.main ul,
.main ol {
  margin: 0 0 1rem;
  padding-inline-start: 1.3rem;
  color: var(--fg-2);
}
.main li {
  margin-bottom: 0.3rem;
}
.muted {
  color: var(--muted);
  font-size: 14px;
}

.hero {
  padding: 1rem 0 0.5rem;
}
.hero .lede {
  max-width: 40rem;
  font-size: 1.15rem;
  color: var(--fg-2);
}
.lede {
  font-size: 1.1rem;
  color: var(--fg-2);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.main .btn,
.actions .btn {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  text-decoration: none;
}
.main .btn:hover {
  background: var(--brand-2);
  color: var(--on-brand);
}
.main .btn.secondary {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--fg);
}
.main .btn.secondary:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}

/* ── Page hero, stat tiles, cards: the structure of the inner pages ─────────────── */
.page-hero {
  position: relative;
  margin: 0 0 2rem;
  padding: 2rem 1.75rem 1.75rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 11%, var(--surface)) 0%, var(--surface) 62%);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  inset-inline-end: -2.5rem;
  top: -2.5rem;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 18%, transparent), transparent 68%);
  pointer-events: none;
}
.page-hero h1 {
  margin-bottom: 0.6rem;
}
.page-hero .lede {
  max-width: 38rem;
  margin: 0;
}
.page-hero .actions {
  margin: 1.25rem 0 0;
}
.eyebrow {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-ink);
  word-spacing: normal;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.stat {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.stat__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  word-spacing: normal;
}
.stat__value {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  word-spacing: normal;
}
.stat__value--text {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.35rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px color-mix(in srgb, #000 8%, transparent);
}
.card h2 {
  margin: 0.2rem 0 0.15rem;
  font-size: 1.1rem;
}
.card p {
  margin: 0 0 0.5rem;
}
.card .tag {
  align-self: flex-start;
}
.card .btn {
  align-self: flex-start;
  height: 40px;
  margin-top: 0.25rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.25rem 0 0.25rem;
}
.chips a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand-ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.chips a:hover {
  border-color: var(--brand);
  background: var(--brand-dim);
}
.limits {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
  padding: 0;
  list-style: none;
}
.limits li {
  margin: 0;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--warn);
  border-radius: 12px;
}
.main h2.section {
  margin-top: 2.25rem;
}

/* Feature list as cards (home). */
.main ul.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem;
  list-style: none;
  padding: 0;
}
.main ul.cards li {
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px color-mix(in srgb, #000 8%, transparent);
}

/* Code, tables, notes */
code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.86em;
  word-spacing: normal;
}
pre {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
pre code {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.6;
}
table {
  width: 100%;
  margin: 1rem 0 1.25rem;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14.5px;
}
th,
td {
  padding: 0.6rem 0.8rem;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
tr:last-child td {
  border-bottom: 0;
}
th {
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  word-spacing: normal;
}
td:first-child {
  font-weight: 600;
}
.req {
  color: var(--brand-ink);
  font-weight: 700;
}
.note,
.callout {
  margin: 1.25rem 0;
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--brand);
  border-radius: 10px;
  color: var(--fg-2);
}
.note {
  border-inline-start-color: var(--warn);
}
dl {
  margin: 0 0 1rem;
}
dl div {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
dt {
  flex: 0 0 11rem;
  font-weight: 700;
  color: var(--fg);
}
dd {
  margin: 0;
  color: var(--fg-2);
}

/* ── Footer: lockup and tagline, three link columns, a bottom bar ────────────────── */
.footer {
  margin-top: 3rem;
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 1.25rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand p {
  max-width: 19rem;
  margin: 0.85rem 0 0;
  line-height: 1.55;
}
.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.footer-col .eyebrow {
  margin: 0 0 0.35rem;
}
.footer-col a {
  color: var(--fg-2);
  font-weight: 500;
  text-decoration: none;
}
.footer-col a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.footer-status {
  flex-basis: 100%;
  color: var(--muted);
}

@media (max-width: 760px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: 0.4rem;
  }
  .nav {
    order: 3;
    flex: 1 0 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .nav a {
    flex: none;
  }
  .theme-btn {
    margin-inline-start: auto;
  }
  .main {
    padding-top: 1.75rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 1rem;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .page-hero {
    padding: 1.5rem 1.15rem 1.35rem;
    border-radius: 16px;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  dl div {
    flex-direction: column;
    gap: 2px;
  }
  dt {
    flex: none;
  }
  td:first-child {
    white-space: normal;
  }
  table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
