/* AstroVista Lite website: one stylesheet for every page, light and dark */
:root {
  --bg: #fbfbfd;
  --panel: #ffffff;
  --text: #1d2330;
  --muted: #5b6475;
  --line: #e2e5ec;
  --accent: #2f7fd8;
  --accent-soft: #e8f1fc;
  --green: #3c9a3c;
  --code-bg: #f2f4f8;
  --term-bg: #1b1e26;
  --term-text: #e6e9ef;
  --q-bg: #fff8e1;
  --q-line: #f0c94b;
  --shadow: 0 6px 24px rgba(20, 30, 50, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151c;
    --panel: #1a1e27;
    --text: #e4e7ee;
    --muted: #9aa3b5;
    --line: #2b313d;
    --accent: #6aa8ff;
    --accent-soft: #1d2a3d;
    --green: #6cc46c;
    --code-bg: #222734;
    --term-bg: #0d0f14;
    --term-text: #e6e9ef;
    --q-bg: #2b2616;
    --q-line: #8a7426;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  --bg: #12151c;
  --panel: #1a1e27;
  --text: #e4e7ee;
  --muted: #9aa3b5;
  --line: #2b313d;
  --accent: #6aa8ff;
  --accent-soft: #1d2a3d;
  --green: #6cc46c;
  --code-bg: #222734;
  --term-bg: #0d0f14;
  --term-text: #e6e9ef;
  --q-bg: #2b2616;
  --q-line: #8a7426;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* the bar at the top of every page */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); }
.brand img { width: 30px; height: 30px; }
.top nav { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; font-size: 15px; }
.top nav a { color: var(--muted); }
.top nav a.here, .top nav a:hover { color: var(--text); text-decoration: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }

/* the opening of the home page */
.hero { padding: 56px 0 24px; text-align: center; }
.hero h1 { font-size: clamp(34px, 6vw, 52px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -0.02em; }
.hero p.lead { font-size: clamp(17px, 2.4vw, 20px); color: var(--muted); max-width: 720px; margin: 0 auto 24px; }
.buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.button {
  display: inline-block; padding: 10px 18px; border-radius: 10px; font-weight: 600;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
}
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button:hover { text-decoration: none; filter: brightness(1.05); }

figure { margin: 24px 0; }
figure img, .shot {
  display: block; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow);
  background: var(--panel);
}
figcaption { color: var(--muted); font-size: 14.5px; margin-top: 8px; text-align: center; }

section { padding: 40px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }
h2 { font-size: clamp(26px, 4vw, 32px); margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 21px; margin: 28px 0 8px; }
.kicker { color: var(--accent); font-weight: 650; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 6px; }

/* cards of features */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* a picture beside its text */
.row { display: grid; grid-template-columns: 1fr 1.35fr; gap: 28px; align-items: center; margin: 28px 0; }
.row.flip { grid-template-columns: 1.35fr 1fr; }
.row.flip > :first-child { order: 2; }
@media (max-width: 820px) {
  .row, .row.flip { grid-template-columns: 1fr; }
  .row.flip > :first-child { order: 0; }
}
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.gallery figure { margin: 0; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.9em; }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 5px; }
pre {
  background: var(--term-bg); color: var(--term-text); padding: 14px 16px; border-radius: 10px;
  overflow-x: auto; line-height: 1.5;
}
pre code { background: none; padding: 0; color: inherit; }
pre .c { color: #8b95a7; }

/* questions for learners */
.question {
  background: var(--q-bg); border-left: 4px solid var(--q-line); border-radius: 8px;
  padding: 12px 16px; margin: 16px 0;
}
.question b:first-child { display: block; margin-bottom: 2px; }
.note { background: var(--accent-soft); border-radius: 8px; padding: 12px 16px; margin: 16px 0; }

/* steps of the tutorial */
.steps { counter-reset: step; list-style: none; padding: 0; }
.step { counter-increment: step; position: relative; padding-left: 54px; margin: 36px 0; }
.step::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.step h3 { margin-top: 4px; }
@media (max-width: 560px) { .step { padding-left: 0; } .step::before { position: static; margin-bottom: 8px; } }

table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 15.5px; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; margin: 20px 0; }
.toc ol { margin: 6px 0 0; padding-left: 20px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14.5px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* the generated reference and terminal pages */
.doc h2 { margin-top: 44px; padding-top: 12px; border-top: 1px solid var(--line); }
.doc h3 { margin-top: 30px; }
.doc h3 code { font-size: 0.95em; background: none; padding: 0; color: var(--accent); }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc pre:not(:has(code)) { background: var(--code-bg); color: var(--text); }
.monsta {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; vertical-align: middle; letter-spacing: 0.02em;
  background: var(--accent-soft); color: var(--accent); font-family: inherit;
}
