@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* ── Design tokens ────────────────────────────────────────────────────────
   Trimmed port of kiroku-web's public/assets/css/main.css so this site looks
   like the same product as kiroku.cz. Keep the tokens in sync with that file
   (which in turn mirrors the app palette in src/styles/theme/colors.ts).

   Light ("Clean light") is the default; dark ("Midnight") values come from
   light-dark(). The effective scheme follows the system preference unless
   the user picks one explicitly — theme.js then sets data-theme on <html>,
   which forces color-scheme below. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #0d1117);
  --surface: light-dark(#f6f8fa, #151b23);
  --text-strong: light-dark(#1f2329, #f0f6fc);
  --text: light-dark(#2f3339, #e1e7ed);
  --muted: light-dark(#59636e, #9198a1);
  --faint: light-dark(#59636e, #9198a1);
  --border: light-dark(#d0d9e0, #3d444d);
  --accent: #f5c400;
  --link: light-dark(#0164bf, #5ab0ff);
  --link-hover: light-dark(#0676de, #b0d9ff);
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────── */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  /* fallbacks for browsers without light-dark() support */
  background: #ffffff;
  color: #2f3339;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  width: 100%;
}

h1,
h2,
h3 {
  color: var(--text-strong);
  line-height: 1.25;
}

h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 26px 0 8px;
}

p,
ul,
ol {
  margin: 0 0 16px;
}

ul,
ol {
  padding-left: 22px;
}

li {
  margin-bottom: 8px;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--link-hover);
}

strong {
  color: var(--text-strong);
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* ── Code ─────────────────────────────────────────────────────────────── */

code,
pre {
  font-family:
    ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.85em;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 16px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.55;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* ── Tables ───────────────────────────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 16px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  line-height: 1.55;
}

th,
td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 600;
  white-space: nowrap;
}

td code {
  white-space: nowrap;
}

/* ── Callout ──────────────────────────────────────────────────────────── */

.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 16px;
}

.note :last-child {
  margin-bottom: 0;
}

/* ── Top bar (brand · theme toggle) ───────────────────────────────────── */

.topbar {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 20px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-strong);
  font-weight: 600;
  font-size: 15px;
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: block;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text-strong);
  border-color: var(--muted);
}

.theme-toggle svg {
  display: block;
}

/* Sun shows in light, moon in dark — both for explicit choice (data-theme)
   and for the system default (no data-theme). */
.theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .theme-toggle .icon-sun {
    display: none;
  }

  html:not([data-theme]) .theme-toggle .icon-moon {
    display: block;
  }
}

/* ── Landing hero ─────────────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 20px 40px;
}

.app-logo {
  width: 96px;
  border-radius: 22%;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 2.4rem;
  margin: 0;
}

.hero h1::after {
  content: "";
  display: block;
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  margin: 16px auto 0;
}

.hero p {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 14px 0 32px;
  max-width: 32em;
}

.hero .actions + p {
  margin-top: 32px;
  font-size: 0.95rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.button {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.button:hover {
  border-color: var(--muted);
  color: var(--text-strong);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1f2329;
}

.button.primary:hover {
  filter: brightness(0.96);
}

/* ── Docs nav ─────────────────────────────────────────────────────────── */

.docs-nav {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.docs-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0 8px;
}

.docs-nav a:hover {
  color: var(--text-strong);
}

.docs-nav a[aria-current="page"] {
  color: var(--text-strong);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ── Document pages ───────────────────────────────────────────────────── */

main.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

main.doc header {
  margin: 16px 0 32px;
}

main.doc header p {
  color: var(--faint);
  font-size: 14px;
  margin: 8px 0 0;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

footer {
  text-align: center;
  padding: 28px 20px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: center;
  margin-bottom: 10px;
}

footer nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
}

footer nav a:hover {
  color: var(--text-strong);
}

footer p {
  color: var(--faint);
  margin: 0;
  font-size: 12.5px;
}
