/* The application's look, translated back to the web it came from.
 *
 * The app styles itself with AtlantaFX's Primer theme — a JavaFX port of
 * GitHub's Primer design system — so the palette below is Primer's, with the
 * lime of the application icon as the brand colour. Light and dark follow
 * the system by default, exactly as the app does; the toggle in the header
 * sets data-theme and wins over the system, so both selector forms appear
 * for every dark rule.
 */

:root {
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --fg: #1f2328;
  --fg-muted: #656d76;
  --border: #d0d7de;
  --border-muted: #d8dee4;
  --accent: #0969da;
  --accent-fg: #ffffff;
  --lime-top: #8fd41f;
  --lime-foot: #65a30d;
  --ink: #1a2e05;
  --shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-subtle: #161b22;
    --fg: #e6edf3;
    --fg-muted: #8b949e;
    --border: #30363d;
    --border-muted: #21262d;
    --accent: #2f81f7;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --fg: #1f2328;
  --fg-muted: #656d76;
  --border: #d0d7de;
  --border-muted: #d8dee4;
  --accent: #0969da;
  --shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-subtle: #161b22;
  --fg: #e6edf3;
  --fg-muted: #8b949e;
  --border: #30363d;
  --border-muted: #21262d;
  --accent: #2f81f7;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}
code, pre, .ipa {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header — the app's menu bar, roughly. */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-muted);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 2;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-size: 15px;
}
.wordmark img { border-radius: 6px; }
.top nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.top nav a { color: var(--fg); }
#theme {
  width: 28px;
  height: 28px;
  border-radius: 14px;                 /* the app's round ? and i buttons */
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}
#theme:hover { background: var(--bg-subtle); }

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

/* Landing */
.hero { text-align: center; padding: 40px 0 8px; }
.hero-icon { border-radius: 20px; box-shadow: var(--shadow); }
.hero h1 { margin: 16px 0 4px; font-size: 40px; letter-spacing: -0.5px; }
.tag { margin: 0 0 24px; font-size: 19px; color: var(--fg-muted); }
.dl { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--fg);
  font-size: 15px;
}
.btn:hover { text-decoration: none; filter: brightness(0.97); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.dl-note { color: var(--fg-muted); font-size: 13.5px; }

.cleave { max-width: 560px; margin: 28px auto; }
.cleave ol { margin: 6px 0; padding-left: 22px; }
.ipa { color: var(--fg-muted); }
.muted { color: var(--fg-muted); }

.card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: 10px;
  padding: 16px 18px;
}
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; font-size: 14.5px; color: var(--fg-muted); }
.card p a { color: var(--accent); }

.shot { text-align: center; margin: 32px 0; }
.shot img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.only-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .only-light { display: none; }
  .only-dark { display: inline; }
}
:root[data-theme="light"] .only-light { display: inline; }
:root[data-theme="light"] .only-dark { display: none; }
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="dark"] .only-dark { display: inline; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

/* Docs shell */
.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.side { font-size: 14px; }
.side h3 {
  margin: 18px 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--fg-muted);
}
.side h3:first-child { margin-top: 4px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li { margin: 2px 0; }
.side a {
  display: block;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--fg);
}
.side a:hover { background: var(--bg-subtle); text-decoration: none; }
.side a.here {
  background: var(--accent);
  color: var(--accent-fg);   /* the app's selected pill */
}
.doc { min-width: 0; }
.doc h1 { font-size: 30px; margin-top: 8px; }
.doc h1, .doc h2 { padding-bottom: 6px; border-bottom: 1px solid var(--border-muted); }
.doc pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 13.5px;
}
.doc code { font-size: 0.92em; }
.doc :not(pre) > code {
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: 4px;
  padding: 1px 5px;
  overflow-wrap: anywhere;   /* long test names must wrap, not widen the page */
}
.doc table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  font-size: 14px;
}
.doc th, .doc td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.doc th { background: var(--bg-subtle); }
.doc blockquote {
  margin: 0;
  padding: 2px 16px;
  border-left: 3px solid var(--lime-foot);
  color: var(--fg-muted);
}
.doc img { max-width: 100%; }

footer {
  border-top: 1px solid var(--border-muted);
  padding: 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--fg-muted);
}
footer p { margin: 4px 0; }

@media (max-width: 760px) {
  /* minmax(0, …), not bare 1fr: an fr track's minimum is the content's
     min-content size, so one long unbreakable token widens the whole page. */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { order: 2; }
  .hero h1 { font-size: 32px; }
}
