/* srtc.space — one stylesheet for all three pages.
   Deliberately dependency-free: no CDN fonts, no framework, no JS. The whole site
   is a few files served from Firebase Hosting, so every byte here is a byte the
   visitor waits for. Dark-only by design — it is a space-physics tool. */

:root {
  --bg: #070b14;
  --bg-soft: #0d1524;
  --surface: #111b2e;
  --border: #1f2d45;
  --text: #dde5f2;
  --muted: #93a6c2;
  --accent: #56a8ff;
  --good: #7ee0c0;
  --warn: #ffc46b;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wide: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Faint orbital wash behind everything, so the page is not flat black. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 78% -8%, rgba(86, 168, 255, .14), transparent 70%),
    radial-gradient(700px 420px at 8% 4%, rgba(126, 224, 192, .08), transparent 70%);
  z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: var(--wide); margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- nav */
header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(7, 11, 20, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 28px; height: 62px; }
.brand { font-weight: 700; letter-spacing: .5px; color: var(--text); font-size: 1.05rem; }
.brand span { color: var(--accent); }
.nav nav { margin-left: auto; display: flex; gap: 22px; }
.nav nav a { color: var(--muted); font-size: .95rem; }
.nav nav a:hover, .nav nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
.nav nav a[aria-current="page"] { border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 56px 0 24px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: center; }
.hero h1 { font-size: 2.6rem; line-height: 1.12; margin: 0 0 6px; letter-spacing: -.5px; }
.hero .full { color: var(--muted); font-size: 1.12rem; font-weight: 500; margin: 0 0 20px; }
.hero p.lede { font-size: 1.06rem; color: var(--text); margin: 0 0 26px; }
.hero img { width: 100%; height: auto; display: block; }

/* Prerequisite line under the hero CTA — visible before anyone clicks Download,
   which is the whole point of it. */
.hero p.req {
  margin: 18px 0 0;
  font-size: .92rem;
  color: var(--muted);
  max-width: 56ch;
}
.hero p.req strong { color: var(--text); font-weight: 600; }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .4px;
  color: var(--warn);
  border: 1px solid rgba(255, 196, 107, .35);
  background: rgba(255, 196, 107, .08);
  border-radius: 999px;
  padding: 3px 11px;
  margin-bottom: 16px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #04101f;
  font-weight: 650;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.btn:hover { background: #7bbcff; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--bg-soft); border-color: var(--accent); }
.btn + .btn { margin-left: 10px; }

/* ---------------------------------------------------------------- sections */
section { padding: 40px 0; }
section > h2 {
  font-size: 1.5rem;
  margin: 0 0 8px;
  letter-spacing: -.2px;
}
section > p.sub { color: var(--muted); margin: 0 0 24px; max-width: 72ch; }
h3 { font-size: 1.12rem; margin: 28px 0 8px; }
p { max-width: 78ch; }

hr.rule { border: 0; border-top: 1px solid var(--border); margin: 8px 0 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 18px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
}
.card h3 { margin: 0 0 6px; font-size: 1.03rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------------------------------------------------------------- tables */
.table-scroll { overflow-x: auto; margin: 18px 0; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; min-width: 520px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .6px; }
tbody tr:last-child td { border-bottom: 0; }
td code { font-size: .88em; }

/* ---------------------------------------------------------------- code */
code {
  font-family: var(--mono);
  font-size: .9em;
  background: rgba(86, 168, 255, .1);
  border: 1px solid rgba(86, 168, 255, .16);
  border-radius: 4px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}
pre {
  background: #060a12;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.55;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* ---------------------------------------------------------------- downloads */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; }
.dl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.dl-card h3 { margin: 0 0 2px; font-size: 1.15rem; }
.dl-card .for { color: var(--muted); font-size: .92rem; margin: 0 0 16px; }
.dl-card .meta { color: var(--muted); font-size: .85rem; font-family: var(--mono); margin: 14px 0 0; }
.dl-card .btn { align-self: flex-start; }
.hash {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--muted);
  word-break: break-all;
  background: #060a12;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 12px;
}

/* ------------------------------------------------------------ download gate */
.gate {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 22px 0 18px;
}
.gate label {
  display: block;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 8px;
}
.gate input {
  width: 100%;
  max-width: 380px;
  font: inherit;
  font-size: .95rem;
  color: var(--text);
  background: #060a12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.gate input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.gate-note { margin: 12px 0 0; color: var(--muted); font-size: .88rem; }
.gate-msg { margin: 10px 0 0; font-size: .9rem; min-height: 1.2em; }
.gate-msg.bad  { color: var(--warn); }
.gate-msg.good { color: var(--good); }

button.btn { font: inherit; cursor: pointer; }
button.btn:disabled { opacity: .6; cursor: progress; }
.linklike {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--accent); cursor: pointer; text-decoration: underline;
}

/* ---------------------------------------------------------------- figures */
/* Charts are inline SVG generated by scripts/make_site_plots.py — they scale
   with the card rather than carrying fixed pixel sizes, so the grid can reflow
   to one column on a phone without the axis text collapsing. */
.figs { display: grid; gap: 18px; margin: 20px 0; }
.figs-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.fig {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px 6px;
  overflow-x: auto;
}
.fig svg { display: block; width: 100%; height: auto; }

.note {
  border-left: 3px solid var(--accent);
  background: rgba(86, 168, 255, .06);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 22px 0;
}
.note.warn { border-left-color: var(--warn); background: rgba(255, 196, 107, .06); }
.note p { margin: 0; }
.note p + p { margin-top: 8px; }

ul.tight { margin: 10px 0; padding-left: 22px; }
ul.tight li { margin: 5px 0; }

/* ---------------------------------------------------------------- footer */
footer {
  border-top: 1px solid var(--border);
  margin-top: 56px;
  padding: 26px 0 44px;
  color: var(--muted);
  font-size: .88rem;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
footer .ver { font-family: var(--mono); margin-left: auto; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: 2.1rem; }
  body { font-size: 16px; }
  .nav { gap: 16px; }
  .nav nav { gap: 15px; }
  footer .ver { margin-left: 0; width: 100%; }
}

/* ---------------------------------------------------------------- docs */
/* Generated by web/tools/build-docs.mjs from the repo markdown — never hand-edit
   site/docs. Two columns on desktop; the sidebar stacks above the prose on narrow
   screens so the table of contents is still reachable rather than hidden. */
.docs-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-top: 28px;
}
.docs-side { position: sticky; top: 82px; max-height: calc(100vh - 110px); overflow-y: auto; }
.docs-side-sec {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted); margin: 0 0 8px;
}
.docs-side-sec + .docs-toc, .docs-nav + .docs-side-sec { margin-top: 22px; }
.docs-nav, .docs-toc { display: flex; flex-direction: column; gap: 2px; }
.docs-nav a, .docs-toc a {
  color: var(--muted); font-size: .88rem; padding: 3px 8px;
  border-left: 2px solid transparent; border-radius: 0 4px 4px 0;
}
.docs-nav a:hover, .docs-toc a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.docs-nav a.on { color: var(--text); border-left-color: var(--accent); background: var(--bg-soft); }
.docs-toc a.lvl3 { padding-left: 20px; font-size: .84rem; }

.docs-main { min-width: 0; padding-bottom: 40px; }
.docs-main h1 { font-size: 1.9rem; margin: 0 0 18px; letter-spacing: -.3px; }
.docs-main h2 { font-size: 1.35rem; margin: 34px 0 10px; padding-top: 6px; }
.docs-main h3 { font-size: 1.08rem; margin: 24px 0 8px; }
.docs-main h4 { font-size: .98rem; margin: 18px 0 6px; }
/* Anchored headings: the link is invisible until hovered, so the heading reads
   normally but every section is still linkable. */
.docs-main .anchor { color: inherit; text-decoration: none; }
.docs-main .anchor:hover { text-decoration: none; }
.docs-main .anchor:hover::after {
  content: " #"; color: var(--accent); font-weight: 400;
}
.docs-main :target { scroll-margin-top: 86px; }
.docs-main p, .docs-main li { max-width: 82ch; }
.docs-main ul, .docs-main ol { padding-left: 22px; }
.docs-main li { margin: 4px 0; }
.docs-main blockquote {
  margin: 18px 0; padding: 12px 18px;
  border-left: 3px solid var(--accent);
  background: rgba(86, 168, 255, .06);
  border-radius: 0 8px 8px 0;
}
.docs-main blockquote > :first-child { margin-top: 0; }
.docs-main blockquote > :last-child { margin-bottom: 0; }
.docs-main hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.docs-main img { max-width: 100%; height: auto; }

a.doc-card { display: block; color: inherit; }
a.doc-card:hover { border-color: var(--accent); text-decoration: none; }
a.doc-card h3 { color: var(--accent); }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 20px; }
  .docs-side { position: static; max-height: none; }
  .docs-toc { max-height: 260px; overflow-y: auto; }
}

/* 3D-forward-vs-PHITS cross-check tables (generated by scripts/make_site_plots.py). */
.phits-case { margin-top: 22px; }
.phits-case h4 { margin: 0 0 4px; font-size: 15px; }
table.cmp { border-collapse: collapse; margin: 10px 0 6px; font-size: 13px; }
table.cmp th, table.cmp td {
  padding: 5px 14px 5px 0; text-align: left; border-bottom: 1px solid #22314b;
}
table.cmp th { color: #93a6c2; font-weight: 600; }
table.cmp td:not(:first-child) { font-variant-numeric: tabular-nums; }
.files { font-size: 12px; color: #93a6c2; margin: 4px 0 0; line-height: 1.6; }
.files code { font-size: 11.5px; }
