/* SPDX-License-Identifier: AGPL-3.0-only */
/* The colours are the apps' default palette, "terminal", from
   apps/design/tokens.json (go run ./tools/tokens checks their contrast). */

:root {
  --bg: #E8EFEF;
  --surface: #FFFFFF;
  --grid: #E2EFE8;
  --text: #111318;
  --dim: #4F5462;
  --accent: #0A7A3E;
  --on-accent: #FFFFFF;
  --line: #C9D6D2;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1914;
    --surface: #182D27;
    --grid: #1B4030;
    --text: #ECEEF5;
    --dim: #9EA2B0;
    --accent: #3DFF8A;
    --on-accent: #0A0B0F;
    --line: #2A4A40;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans Devanagari", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
code { background: var(--grid); padding: .1em .35em; border-radius: 6px; direction: ltr; unicode-bidi: isolate; white-space: nowrap; display: inline-block; max-width: 100%; overflow-x: auto; vertical-align: bottom; }
pre {
  background: var(--grid); padding: 12px 14px; border-radius: 10px;
  overflow-x: auto; direction: ltr; text-align: left; white-space: pre;
}
pre code { background: none; padding: 0; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(32px, 6vw, 52px); margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 28px; margin: 56px 0 16px; }
h3 { font-size: 19px; margin: 0 0 8px; }

.wrap { max-width: 1040px; margin: 0 auto; padding-inline: 16px; }
.dim { color: var(--dim); }
.lead { font-size: 20px; color: var(--dim); max-width: 720px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.bar { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; text-decoration: none; }
.brand img { border-radius: 8px; display: block; }
nav { display: flex; gap: 18px; flex-wrap: wrap; margin-inline-start: auto; }
nav a { color: var(--dim); text-decoration: none; font-weight: 500; padding: 10px 0; }
nav a:hover, nav a[aria-current] { color: var(--accent); }

.langs { position: relative; }
.langs summary {
  cursor: pointer; list-style: none; padding: 6px 14px; border: 1px solid var(--line);
  border-radius: 22px; color: var(--text); min-height: 44px; display: flex; align-items: center;
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary::before { content: "🌐 "; }
.langs ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); margin: 0; padding: 6px;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  min-width: 170px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
.langs li a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.langs li a:hover { background: var(--grid); }
.langs li a[aria-current] { color: var(--accent); font-weight: 600; }

.hero { padding: 72px 0 24px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 22px;
  border-radius: 22px; text-decoration: none; font-weight: 600;
  border: 1px solid var(--line); color: var(--text); background: var(--surface);
}
.button.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.button.go::after { content: "→"; display: inline-block; }
[dir="rtl"] .button.go::after { content: "←"; }
.button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; inset-inline-start: 16px; top: -100px; z-index: 3; }
.skip:focus { top: 8px; background: var(--surface); padding: 10px 14px; border-radius: 10px; }

.platforms { color: var(--dim); font-weight: 600; letter-spacing: .02em; margin: 8px 0 0; }
[dir="rtl"] .platforms { text-align: right; }

.facts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 24px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.facts strong { display: block; color: var(--accent); }
.facts span { color: var(--dim); font-size: 15px; }

.compare td { text-align: center; color: var(--accent); font-weight: 700; font-size: 20px; }
.compare td.no { color: var(--dim); font-weight: 400; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.compare tr.us th { color: var(--accent); }
.compare th { white-space: normal; }

.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; min-height: 44px; }
.faq details p { margin: 0; padding: 0 18px 16px; }

.final { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 8px 24px 24px; margin-top: 56px; }
.final h2 { margin-top: 24px; }

.oops { text-align: center; padding-bottom: 40px; }
.oops .lead { margin-inline: auto; }
.oops .actions { justify-content: center; }
.oops .code { font: 700 72px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--accent); margin: 24px 0 8px; }

.dock { display: none; }

.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); border-radius: 14px; overflow: hidden; }
th, td { padding: 12px 16px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
tr:last-child th, tr:last-child td { border-bottom: none; }
th { white-space: nowrap; }

.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cards.four { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; min-width: 0; }
.lead, .page p, .page li, section > p { max-width: 75ch; }
.card p { margin: 0 0 10px; }
.card ul { padding-inline-start: 20px; margin: 12px 0 0; }
.card li { margin-bottom: 6px; }
.badge {
  display: inline-block; font-size: 13px; font-weight: 700; color: var(--on-accent); background: var(--accent);
  padding: 2px 10px; border-radius: 10px; margin: 0 0 8px;
}
.note { border-inline-start: 4px solid var(--accent); background: var(--surface); padding: 14px 18px; border-radius: 10px; margin-top: 20px; }

.orbit {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 56px);
  max-width: 340px; margin: 16px auto 8px;
}
.orbit svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbit path { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 5; fill: none; vector-effect: non-scaling-stroke; opacity: .7; }
.node {
  position: relative; place-self: center; padding: 5px 12px; border-radius: 16px; font-size: 14px;
  background: var(--grid); border: 1px solid var(--line); white-space: nowrap;
}
.node.n1 { grid-area: 1 / 1; }
.node.n2 { grid-area: 1 / 3; }
.node.hub { grid-area: 2 / 2; background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.node.n3 { grid-area: 3 / 1; }
.node.n4 { grid-area: 3 / 3; }

.steps { padding-inline-start: 22px; }
.steps li { margin-bottom: 10px; }
.page { padding-top: 40px; }
.page ul { padding-inline-start: 22px; }

.foot { margin-top: 72px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--dim); font-size: 15px; }
.foot a { color: var(--dim); }

@media (max-width: 640px) {
  body { font-size: 16px; padding-bottom: 76px; }
  .dock {
    display: block; position: fixed; inset-inline: 0; bottom: 0; z-index: 2; margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .dock .button { width: 100%; justify-content: center; }
  .hero { padding-top: 40px; }
  nav { width: 100%; margin-inline-start: 0; order: 3; padding-bottom: 10px; }
  .langs { margin-inline-start: auto; }
  h2 { font-size: 24px; margin-top: 40px; }
  th { white-space: normal; }
  .top { position: static; }
  nav { gap: 0 16px; }
  .compare { font-size: 14px; hyphens: auto; }
  .compare th, .compare td { padding: 10px 8px; }
}

/* Motion: short, and none for those who ask for less. The scroll-driven
   parts need a browser that has animation-timeline; elsewhere the page is
   simply still. */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .lead, .hero .platforms, .hero .actions { animation: rise .6s ease-out both; }
  .hero .lead { animation-delay: .1s; }
  .hero .platforms { animation-delay: .2s; }
  .hero .actions { animation-delay: .3s; }
  .card, .facts div { transition: transform .2s ease-out, box-shadow .2s ease-out; }
  .card:hover, .facts div:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
  .button { transition: filter .2s; }
  .button:hover { filter: brightness(1.08); }
  .button.go::after { transition: transform .2s ease-out; }
  .button.go:hover::after { transform: translateX(4px); }
  [dir="rtl"] .button.go:hover::after { transform: translateX(-4px); }
  @supports (animation-timeline: view()) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
  }
  @supports (animation-timeline: scroll()) {
    .top .bar { animation: shrink linear both; animation-timeline: scroll(); animation-range: 0 120px; }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes shrink { from { min-height: 60px; } to { min-height: 48px; } }

.soon { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-block: 40px; }
.soon img { border-radius: 22px; display: block; }
.soon h1 { margin-top: 20px; }
.soon p { margin: 6px 0; }
.soon p[dir="rtl"] { text-align: right; }
