/* Spacewright site. Plain CSS, no web fonts, no scripts. Light and dark themes. */

:root {
  --bg: #fbfaf7;
  --bg-soft: #f2f0ea;
  --card: #ffffff;
  --text: #1d2026;
  --muted: #555b66;
  --line: #e2ded4;
  --brand: #0e6e6a;
  --brand-strong: #0a5552;
  --brand-soft: #e3f2f0;
  --accent: #a3540d;
  --code-bg: #f0eee8;
  --ph-bg: #fff1b8;
  --ph-text: #5a3d00;
  --warn-bg: #fff6e5;
  --warn-line: #e9c27a;
  --radius: 10px;
  --wrap: 1080px;
  --text-wrap: 760px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --bg-soft: #1a1d21;
    --card: #1b1f24;
    --text: #e8e6e1;
    --muted: #a9adb5;
    --line: #2d3238;
    --brand: #5cc8c0;
    --brand-strong: #86dbd4;
    --brand-soft: #173533;
    --accent: #f0a54a;
    --code-bg: #23272d;
    --ph-bg: #4a3b10;
    --ph-text: #ffe6a0;
    --warn-bg: #2a2416;
    --warn-line: #6b5420;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; }

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3 { line-height: 1.25; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin-top: .4em; letter-spacing: -0.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
p, ul, ol { margin: 0 0 1em; }
li { margin: .25em 0; }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .9em;
  background: var(--code-bg);
  padding: .1em .35em;
  border-radius: 4px;
}
pre { background: var(--code-bg); padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: .9rem; }
pre code { background: none; padding: 0; }

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

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 6px 10px; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand:hover { color: var(--text); }
.logo { width: 28px; height: 28px; flex: none; }
.logo .f { fill: var(--brand); }
.logo .s { fill: none; stroke: var(--brand); stroke-width: 1.5; }
.main-nav { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.main-nav a { color: var(--muted); text-decoration: none; font-weight: 500; padding: 4px 0; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; }

/* Hero */
.hero { padding: 48px 0 28px; }
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 640px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--brand); color: var(--brand); text-decoration: none; font-weight: 600; }
.btn:hover { background: var(--brand-soft); }
.btn.primary { background: var(--brand); color: var(--bg); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--bg); }

/* Sections and cards */
.section { padding: 26px 0; }
.section > h2:first-child, .section .wrap > h2:first-child { margin-top: 0; }
.band { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 16px 58px; position: relative; margin: 0; }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 15px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; display: grid; place-items: center; }
.steps strong { display: block; margin-bottom: 4px; }

.note { background: var(--brand-soft); border-left: 4px solid var(--brand); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 0 0 1.2em; }
.note p:last-child { margin-bottom: 0; }
.warn { background: var(--warn-bg); border-left: 4px solid var(--warn-line); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 0 0 1.2em; }
.warn p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: .92rem; }

/* Placeholders: highlighted so they cannot be missed. */
.ph { background: var(--ph-bg); color: var(--ph-text); font-weight: 600; padding: 0 .3em; border-radius: 4px; }

/* Tables: scroll inside their box, never the page. */
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--card); }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* Docs layout */
.doc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; padding-top: 28px; padding-bottom: 40px; }
.doc-nav { position: sticky; top: 16px; align-self: start; font-size: .95rem; }
.doc-nav p { font-weight: 700; margin: 0 0 6px; }
.doc-nav ul { list-style: none; margin: 0; padding: 0; }
.doc-nav li { margin: 0; }
.doc-nav a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.doc-nav a:hover { background: var(--bg-soft); color: var(--text); }
.doc-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.doc-body { max-width: var(--text-wrap); min-width: 0; }
.doc-body h1 { margin-top: 0; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Text pages (legal, support, security) */
.page { padding-top: 28px; padding-bottom: 40px; }
.toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; margin: 0 0 1.5em; }
.toc p { margin: 0 0 4px; font-weight: 600; }
.toc ol { margin: 0; padding-left: 1.3em; }
.meta { color: var(--muted); font-size: .95rem; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0 0 1.2em; }
dl.facts dt { font-weight: 600; }
dl.facts dd { margin: 0; }

details { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 10px; background: var(--card); }
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 8px; }
details p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 24px 0 30px; font-size: .93rem; color: var(--muted); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 12px; }
.footer-nav a { color: var(--text); }
.site-footer p { margin: 0 0 6px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { padding-top: 30px; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 18px; }
  .doc-nav { position: static; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--bg-soft); }
  .doc-nav ul { display: flex; flex-wrap: wrap; gap: 4px; }
  .doc-nav a { padding: 4px 9px; }
  dl.facts { grid-template-columns: minmax(0, 1fr); }
  dl.facts dd { margin-bottom: 8px; }
  td code { white-space: normal; }
  th, td { padding: 8px 10px; }
}
