/* Swap141 website. Same colours as the app (src/theme/index.ts). */
:root {
  --bg: #F5F3FF; --surface: #FFFFFF; --surface2: #EFECFB; --text: #1E1B3A; --muted: #625F86; --line: #E3DFF4;
  --primary: #5B4BDB; --primary-ink: #FFFFFF; --primary-soft: #ECE9FF; --primary-text: #4536C2;
  --green-soft: #E3F6EE; --green-text: #16794F;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15131F; --surface: #201E2E; --surface2: #2A2740; --text: #F1EFFF; --muted: #A6A2C9; --line: #36324F;
    --primary: #8E80FF; --primary-ink: #140F33; --primary-soft: #2E2858; --primary-text: #BDB4FF;
    --green-soft: #173A2C; --green-text: #7FDDB3;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 Nunito, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--primary-text); text-underline-offset: 3px; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.mark { width: 44px; height: 44px; flex: none; display: block; }
.brand .num { color: var(--primary); }
.brand b { font: 700 20px Fredoka, system-ui, sans-serif; }
nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
nav a { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 15px; padding: 6px 2px; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }

/* Type */
h1, h2, h3 { font-family: Fredoka, system-ui, sans-serif; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(32px, 6vw, 48px); font-weight: 700; }
h2 { font-size: 26px; font-weight: 700; margin-top: 40px; }
h3 { font-size: 19px; font-weight: 600; margin-top: 24px; }
p, ul, ol { margin: 12px 0 0; }
li + li { margin-top: 6px; }
.muted { color: var(--muted); }
.lead { font-size: 20px; color: var(--muted); }
.small { font-size: 14px; }

/* Blocks */
.hero { padding: 40px 0 24px; display: grid; gap: 18px; justify-items: center; text-align: center; }
.hero-logo { width: 140px; height: 140px; display: block; }
.hero .btns { justify-content: center; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px; }
.card h3 { margin-top: 0; }
.card p { margin-top: 6px; color: var(--muted); }
.emoji { font-size: 30px; line-height: 1; display: block; margin-bottom: 10px; }
.note { background: var(--primary-soft); color: var(--primary-text); border-radius: 16px; padding: 14px 16px; margin-top: 18px; }
.ok { background: var(--green-soft); color: var(--green-text); border-radius: 16px; padding: 14px 16px; margin-top: 18px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; border-radius: 16px; font-weight: 800; text-decoration: none; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.soft { background: var(--surface2); color: var(--text); }
.soon-tag { display: inline-block; vertical-align: middle; margin-left: 8px; background: var(--surface2); color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 800; }
.soon { display: inline-block; background: var(--surface2); color: var(--muted); border-radius: 14px; padding: 10px 16px; font-weight: 700; }

/* Happening now ticker (home page; hidden until /api/activity has moments from the last hour).
   One line on wide screens, up to two on phones. Keep .45s in step with SLIDE_MS in activity.js. */
.ticker { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 20px; margin-top: 8px; }
.ticker[hidden] { display: none; }
.ticker-window { position: relative; flex: 1; min-width: 0; height: 30px; overflow: hidden; }
.ticker-line { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; transition: transform .45s ease, opacity .45s ease; }
.ticker-text { display: block; max-width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 30px; }
.ticker-line.below { transform: translateY(100%); opacity: 0; }
.ticker-line.above { transform: translateY(-100%); opacity: 0; }
.ticker-line b { font-weight: 800; }
.ticker-swap { width: 26px; height: 26px; display: inline-block; vertical-align: middle; margin: 0 2px; }
@media (max-width: 640px) {
  .ticker { border-radius: 18px; padding: 8px 14px; }
  .ticker-window { height: 48px; }
  .ticker-text { white-space: normal; line-height: 24px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
}
@media (prefers-reduced-motion: reduce) { .ticker-line { transition: none; } }
.live-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #2BB673; box-shadow: 0 0 0 0 rgba(43, 182, 115, .5); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgba(43, 182, 115, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 182, 115, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Legal and help pages */
.doc { padding-top: 40px; padding-bottom: 24px; }
.doc .updated { color: var(--muted); margin-top: 8px; }
.doc h2 { font-size: 22px; margin-top: 36px; }
.toc { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 20px; margin-top: 20px; }
.toc ol { margin: 6px 0 0; padding-left: 22px; }
table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 800; }
.table-scroll { overflow-x: auto; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; margin-top: 10px; }
summary { font-weight: 800; cursor: pointer; }
details p { color: var(--muted); }

/* Footer */
footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
footer .wrap { display: grid; gap: 10px; }
footer nav a { font-size: 14px; }
