/* Minimal reference site — light by default, dark optional */
:root{
  --bg:#ffffff;
  --text:#0b1220;
  --muted:#5a677a;
  --card:#ffffff;
  --border:rgba(11,18,32,.12);
  --shadow:0 10px 30px rgba(11,18,32,.08);
  --btn:#0b1220;
  --btnText:#ffffff;
  --btnGhost:rgba(11,18,32,.06);
  --code:#0b1220;
  --codeBg:rgba(11,18,32,.04);
  --focus:rgba(11,18,32,.25);
  --radius:18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

:root[data-theme="dark"]{
  --bg:#0b0c0f;
  --text:#e9edf3;
  --muted:#aab3c2;
  --card:#101218;
  --border:rgba(255,255,255,.14);
  --shadow:0 18px 40px rgba(0,0,0,.45);
  --btn:#ffffff;
  --btnText:#0b0c0f;
  --btnGhost:rgba(255,255,255,.08);
  --code:#e9edf3;
  --codeBg:rgba(255,255,255,.06);
  --focus:rgba(255,255,255,.22);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  background:var(--bg);
  color:var(--text);
  line-height:1.55;
}

.wrap{
  max-width:920px;
  margin:0 auto;
  padding:42px 18px 60px;
}

a{color:inherit}
a:hover{opacity:.92}
a:focus{outline:2px solid var(--focus); outline-offset:2px; border-radius:10px}

.hero, .card{
  border:1px solid var(--border);
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.hero{
  padding:28px 22px 26px;
  margin-bottom:18px;
}

.hero-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.kicker{
  font-size:12px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--muted);
}

.theme{
  appearance:none;
  border:1px solid var(--border);
  background:var(--btnGhost);
  color:var(--text);
  border-radius:999px;
  padding:8px 10px;
  font-weight:800;
  cursor:pointer;
}

h1{
  margin:12px 0 10px;
  font-size:clamp(30px, 5.2vw, 50px);
  letter-spacing:-.02em;
  line-height:1.12;
}

.meta{
  margin:0 0 14px;
  color:var(--muted);
  font-size:14px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.dot{opacity:.65}

.lead{
  margin:0 0 18px;
  font-size:16px;
  max-width:76ch;
}

.buttons{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:14px 0 14px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  text-decoration:none;
  font-weight:700;
  font-size:14px;
  background:var(--btnGhost);
  color:var(--text);
}

.btn.primary{
  background:var(--btn);
  color:var(--btnText);
  border-color:transparent;
}

.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0px)}

.btn.disabled{
  opacity:.55;
  cursor:not-allowed;
  user-select:none;
}

.note{
  margin:6px 0 0;
  color:var(--muted);
  font-size:12.5px;
}

.card{
  padding:22px 22px 18px;
  margin-top:16px;
}

h2{
  margin:0 0 12px;
  font-size:20px;
  letter-spacing:-.01em;
}

.small{color:var(--muted); font-size:13px}
.center{text-align:center}

.figure{
  display:block;
  border-radius:14px;
  overflow:hidden;
  border:1px solid var(--border);
  background:#ffffff; /* keeps diagram readable in dark mode */
}

:root[data-theme="dark"] .figure{ background:#ffffff; }

.figure img{
  display:block;
  width:100%;
  height:auto;
}

.codeblock{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  background:var(--codeBg);
}

.codehead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:9px 12px;
  border-bottom:1px solid var(--border);
  color:var(--muted);
  font-size:12.5px;
}

pre{
  margin:0;
  padding:11px 12px;
  white-space:pre-wrap;
  word-break:break-word;
  font-family:var(--mono);
  font-size:12.5px;
  color:var(--code);
}

.copy{
  appearance:none;
  border:1px solid var(--border);
  background:var(--btnGhost);
  color:var(--text);
  border-radius:12px;
  padding:7px 10px;
  font-weight:800;
  font-size:12px;
  cursor:pointer;
}

.footer{
  margin-top:18px;
  text-align:center;
}
