/* Writing spaces (spaces app): the author page and the Sphinx-style notes. Flat blue and white, see docs/DESIGN.md. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.sp-editbar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap;
  margin: -1rem 0 1.5rem; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--accent-soft); font-size: .9rem; }
.sp-editbar-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.sp-draft { display: inline-block; padding: .05rem .4rem; border-radius: 6px; background: var(--warn-soft); color: var(--warn);
  font: 700 .7rem/1.4 Inter, system-ui, sans-serif; letter-spacing: .03em; text-transform: uppercase; vertical-align: middle; }

/* Author page */
.sp-kicker { margin: 0 0 .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.sp-hero { display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding: 2.5rem 0 2rem; border-bottom: 1px solid var(--line); }
.sp-hero h1 { margin: 0; font: 800 clamp(2rem, 5vw, 3rem)/1.1 var(--display); letter-spacing: -.02em; }
.sp-role { margin: .5rem 0 0; font-size: 1.15rem; font-weight: 600; color: var(--muted); }
.sp-tagline { margin: 1rem 0 0; max-width: 40rem; font-size: 1.05rem; line-height: 1.6; }
.sp-actions { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: 1.6rem; }
.sp-photo { flex: none; width: 220px; height: 220px; object-fit: cover; border-radius: 50%; border: 2px solid var(--fg); }

.sp-about { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; margin-top: 2rem; align-items: start; }
.sp-block + .sp-block { margin-top: 2.2rem; }
.sp-block h2, .sp-card h2 { margin: 0 0 .8rem; font-size: 1.3rem; }
.sp-card { padding: 1.2rem 1.3rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.sp-card + .sp-card { margin-top: 1rem; }
.sp-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.sp-links a { color: var(--accent); font-weight: 600; text-decoration: none; }
.sp-links a:hover { text-decoration: underline; }
.sp-links small { display: block; margin-left: 1.5em; color: var(--muted); }
.sp-mini { margin: 0 0 .6rem; padding-left: 1.2rem; }
.sp-mini li + li { margin-top: .3rem; }
.sp-mini a { color: var(--fg); }
.sp-mini a:hover { color: var(--accent); }

/* Notes: Sphinx-like three columns. Contents on the left, the page in the middle, its headings on the right. */
.sp-doc { display: grid; grid-template-columns: 250px minmax(0, 760px); gap: 2.5rem; justify-content: center; align-items: start; }
.sp-doc.with-side { grid-template-columns: 250px minmax(0, 760px) 200px; }
.sp-toc, .sp-onpage { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto; font-size: .9rem; }
.sp-toc-home { display: block; font-weight: 800; font-size: 1.05rem; color: var(--fg); text-decoration: none; margin-bottom: .6rem; }
.sp-toc-part { margin: 1rem 0 .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sp-toc ol, .sp-onpage ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.sp-toc li a, .sp-onpage li a { display: block; padding: .3rem .8rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.sp-toc li a:hover, .sp-onpage li a:hover, .sp-onpage li a.on { color: var(--accent); }
.sp-toc li a.on { color: var(--accent); font-weight: 700; border-left-color: var(--accent); background: var(--accent-soft); }

.sp-crumbs { margin: 0 0 .6rem; font-size: .85rem; color: var(--muted); }
.sp-crumbs a { color: var(--muted); }
.sp-main h1 { margin: 0 0 1rem; font: 800 clamp(1.8rem, 4vw, 2.4rem)/1.2 var(--display); letter-spacing: -.02em; }
.sp-lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 1.5rem; }
.sp-part h2 { font-size: 1.25rem; margin: 2rem 0 .6rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.sp-contents { margin: 0; padding-left: 1.3rem; }
.sp-contents li { margin: .7rem 0; }
.sp-contents a { color: var(--accent); text-decoration: none; }
.sp-contents a:hover { text-decoration: underline; }
.sp-contents p { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }

/* Topic body */
.sp-prose { font-size: 1.05rem; line-height: 1.75; overflow-wrap: anywhere; }
.sp-prose h2 { font-size: 1.5rem; margin: 2.4rem 0 .7rem; padding-top: .4rem; border-top: 1px solid var(--line); scroll-margin-top: 5rem; }
.sp-prose h3 { font-size: 1.2rem; margin: 1.8rem 0 .5rem; scroll-margin-top: 5rem; }
.sp-prose h4 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; scroll-margin-top: 5rem; }
.sp-prose p { margin: 0 0 1em; }
.sp-prose ul, .sp-prose ol { padding-left: 1.4rem; margin: 0 0 1em; }
.sp-prose a { color: var(--accent); }
.sp-prose img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.sp-prose blockquote { margin: 1.2rem 0; padding: .5rem 1.1rem; border-left: 4px solid var(--accent); background: var(--accent-soft); }
.sp-prose code { font: .88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--accent-soft); padding: .1em .35em; border-radius: 4px; }
.sp-prose pre { position: relative; background: #0d1626; color: #e8eef8; padding: 1rem 1.1rem; border-radius: 10px; overflow-x: auto; font-size: .88rem; line-height: 1.6; }
.sp-prose pre code { background: none; padding: 0; color: inherit; }
.sp-prose table { border-collapse: collapse; display: block; overflow-x: auto; margin: 1.2rem 0; font-size: .95rem; }
.sp-prose th, .sp-prose td { padding: .45rem .75rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.sp-prose th { background: var(--accent-soft); }
.sp-prose .math.block { margin: 1.2rem 0; overflow-x: auto; overflow-y: hidden; text-align: center; }
.sp-prose .math:not(.katex-done) { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.sp-prose .admonition { margin: 1.3rem 0; padding: .8rem 1.1rem; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--accent-soft); }
.sp-prose .admonition > :last-child { margin-bottom: 0; }
.sp-prose .admonition-title { margin: 0 0 .3rem; font-weight: 700; }
.sp-prose .admonition.warning, .sp-prose .admonition.caution, .sp-prose .admonition.attention { border-left-color: var(--warn); background: var(--warn-soft); }
.sp-prose .admonition.danger, .sp-prose .admonition.error { border-left-color: var(--stop); background: #fdecea; }
.sp-prose .admonition.tip, .sp-prose .admonition.hint { border-left-color: var(--ok); background: var(--ok-soft); }
.sp-copy { position: absolute; top: .4rem; right: .4rem; font: 600 .72rem Inter, system-ui, sans-serif; padding: .25rem .6rem; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #e8eef8; cursor: pointer; }
.sp-copy:hover { background: rgba(255, 255, 255, .2); }
.sp-copy:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.sp-further { margin-top: 2.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sp-further h2 { font-size: 1.2rem; margin: 0 0 .8rem; }
.sp-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.sp-pager-link { display: block; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; color: var(--fg); text-decoration: none; font-weight: 600; }
.sp-pager-link small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; margin-bottom: .2rem; }
.sp-pager-link:hover { border-color: var(--accent); color: var(--accent); }
.sp-pager-link.next { text-align: right; grid-column: 2; }
.sp-updated { font-size: .82rem; margin-top: 1.5rem; }

@media (max-width: 1180px) {
  .sp-doc.with-side { grid-template-columns: 230px minmax(0, 760px); }
  .sp-onpage { display: none; }
}
@media (max-width: 860px) {
  .sp-hero { flex-direction: column-reverse; align-items: flex-start; }
  .sp-photo { width: 140px; height: 140px; }
  .sp-about { grid-template-columns: minmax(0, 1fr); }
  .sp-doc, .sp-doc.with-side { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
  .sp-toc { position: static; max-height: none; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 12px; }
  .sp-prose pre { border-radius: 0; margin-left: -1.25rem; margin-right: -1.25rem; }
  .sp-pager { grid-template-columns: 1fr; }
  .sp-pager-link.next { grid-column: 1; }
}
