@font-face {
  font-family: "Keania One";
  src: url("../fonts/KeaniaOne.ttf") format("truetype");
  font-display: block;
}

:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #e8eef2;
  --text: #172026;
  --muted: #55626b;
  --line: #d5dee4;
  --accent: #33b5e5;
  --accent-text: #0b7fae;
  --accent-ink: #062330;
  --discord: #5865f2;
  --code-bg: #e6edf1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .05);
  --radius: 14px;
  --max: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151a;
    --surface: #182027;
    --surface-2: #212b33;
    --text: #e9eef2;
    --muted: #a2afb8;
    --line: #2d3943;
    --accent: #33b5e5;
    --accent-text: #33b5e5;
    --accent-ink: #062330;
    --code-bg: #25303a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent-text); text-underline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
  background: var(--code-bg);
  border-radius: 5px;
  padding: .1em .35em;
}

kbd { border: 1px solid var(--line); font-weight: 600; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Keania One", system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "Keania One", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar { display: none; }

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-discord { background: var(--discord); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn:hover { filter: brightness(1.06); }

.btn svg { width: 20px; height: 20px; flex: none; }

/* Hero */
.hero { padding: 56px 0 40px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 10px;
}

section { padding: 40px 0; }
.section-intro { color: var(--muted); max-width: 640px; margin-bottom: 24px; }

/* Cards & grids */
.grid { display: grid; gap: 16px; }
.grid-apps { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid-features { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.app-card { display: flex; flex-direction: column; gap: 12px; }
.app-card header { display: flex; align-items: center; gap: 12px; }
.app-card img { width: 56px; height: 56px; border-radius: 14px; }
.app-card h3 { margin: 0; }
.app-card .formats { color: var(--muted); font-size: .9rem; margin: 0; }
.app-card .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.app-card .links a {
  flex: 1 1 auto;
  text-align: center;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
}
.app-card .links a.pro { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.feature h3 { display: flex; align-items: center; gap: 8px; }
.feature p { color: var(--muted); margin: 0; }
.feature a { font-weight: 600; }

/* Compare table */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 420px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
td.c { text-align: center; white-space: nowrap; }

/* Discord band */
.discord-band {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  background: var(--discord);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px;
}
.discord-band h2 { margin-bottom: .25em; }
.discord-band p { margin: 0; opacity: .92; }
.discord-band .btn { background: #fff; color: var(--discord); }

/* FAQ */
details.faq {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
}
details.faq summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--accent-text); font-weight: 900; }
details.faq[open] summary::after { content: "\2212"; }
details.faq .body { padding: 0 18px 14px; color: var(--muted); }
details.faq .body p:last-child { margin: 0; }

/* Help page layout */
.help-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 48px;
}

.toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow-y: auto; }
.toc h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px; }
.toc h2:first-child { margin-top: 0; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .95rem; }
.toc a:hover { background: var(--surface-2); }

.toc-mobile { display: none; }

.search {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  margin-bottom: 24px;
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.help-group > h2 { margin: 36px 0 16px; padding-top: 8px; border-top: 2px solid var(--line); }
#no-results + .help-group > h2 { margin-top: 0; border-top: 0; padding-top: 0; }

.topic {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
}
.topic h3 { margin-bottom: .6em; }
.topic ol, .topic ul { padding-left: 1.25em; margin: 0 0 1em; }
.topic li { margin-bottom: .3em; }
.topic > :last-child { margin-bottom: 0; }

.path { font-weight: 600; color: var(--text); background: var(--surface-2); border-radius: 6px; padding: .05em .4em; }

.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  vertical-align: middle;
  background: var(--surface-2);
  color: var(--muted);
}
.badge.pro { background: var(--accent); color: var(--accent-ink); }

.note {
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
  margin: 0 0 1em;
}

.no-results { display: none; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--muted); }

@media (max-width: 820px) {
  .help-layout { grid-template-columns: 1fr; gap: 0; padding-top: 20px; }
  .toc { display: none; }
  .toc-mobile { display: block; margin-bottom: 16px; }
  .toc-mobile details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
  .toc-mobile summary { padding: 12px 16px; font-weight: 700; cursor: pointer; }
  .toc-mobile .inner { padding: 0 8px 10px; columns: 2; column-gap: 8px; }
  .toc-mobile a { display: block; padding: 6px 8px; color: var(--text); text-decoration: none; font-size: .95rem; break-inside: avoid; }
  .discord-band { grid-template-columns: 1fr; padding: 22px; }
  .brand-name-long { display: none; }
}

@media (max-width: 480px) {
  .brand > span:last-child { display: none; }
  .nav a { padding: 8px; }
  .hero { padding: 36px 0 24px; }
  .hero .actions .btn { flex: 1 1 100%; }
  .toc-mobile .inner { columns: 1; }
  .topic { padding: 16px; }
}

/* Legal pages (privacy policy) */
.legal { max-width: 780px; padding-top: 40px; padding-bottom: 48px; }
.legal-switch { color: var(--muted); }
.legal-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.legal-body h2 { font-size: 1.2rem; margin: 1.6em 0 .5em; }
.legal-body ul { padding-left: 1.25em; margin: 0 0 1em; }
.legal-body li { margin-bottom: .3em; }
.legal-body .effective { font-weight: 600; }
.legal-body .credit { color: var(--muted); font-size: .88rem; margin-top: 2em; margin-bottom: 0; }
@media (max-width: 480px) {
  .legal { padding-top: 28px; }
  .legal-body { padding: 18px; }
}

/* Wireframe figures in the help */
.wf { margin: 4px 0 18px; }
.wf svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; overflow: visible; }
.wf-narrow svg { max-width: 380px; }
.wf figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 8px; }
.wf text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 8px; font-weight: 600; }
.wf-f { fill: var(--bg); stroke: var(--muted); stroke-width: 1.5; }
.wf-s { fill: var(--surface-2); stroke: var(--line); }
.wf-m { fill: var(--muted); }
.wf-pop { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
.wf-hl { fill: var(--accent); opacity: .28; }
.wf-hl-o { fill: none; stroke: var(--accent); stroke-width: 2; }
.wf-a { fill: var(--accent); }
.wf-t { fill: var(--text); }
.wf-tm { fill: var(--muted); font-weight: 500 !important; }
.wf-ti { fill: var(--accent-ink); }
.wf-a-t { fill: var(--accent-text); font-size: 10px !important; font-weight: 800 !important; }
.wf-star { fill: var(--accent); }
.wf-lbl { fill: var(--accent-text); font-size: 9px !important; font-weight: 700 !important; }
.wf-as { stroke: var(--accent-text); stroke-width: 1.6; fill: none; }
.wf-ah { fill: var(--accent-text); }
.wf-touch { fill: var(--accent); opacity: .25; }
.wf-slot { fill: var(--accent); opacity: .85; stroke: var(--accent-text); }
.wf-slot-t { fill: var(--accent-ink); font-weight: 800 !important; }
.wf-zone { fill: var(--accent); opacity: .12; }
.wf-dash { stroke: var(--accent-text); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.wf-edit rect { fill: none; stroke: var(--accent-text); stroke-width: 1.3; stroke-dasharray: 4 3; }
.wf-ghost { fill: var(--accent); opacity: .35; }
.wf-box { fill: none; stroke: var(--muted); stroke-width: 1.3; }
.wf-check { fill: none; stroke: var(--accent-ink); stroke-width: 2; }
.wf-line { stroke: var(--line); stroke-width: 1.3; }

/* Language switcher */
.lang { display: flex; gap: 2px; padding-left: 8px; border-left: 1px solid var(--line); }
.lang a { font-size: .8rem; font-weight: 700; color: var(--muted); text-decoration: none; padding: 6px; border-radius: 6px; }
.lang a:hover { background: var(--surface-2); color: var(--text); }
.lang a[aria-current] { color: var(--accent-text); }
@media (max-width: 560px) {
  .nav-opt { display: none; }
  .nav a { padding: 8px 7px; }
}
