:root {
  color-scheme: light dark;
  --sea: light-dark(#0b6f73, #3fd0c8);
  --sea-deep: light-dark(#06585e, #0a767a);
  --brass: light-dark(#8a5a12, #d6aa5c);
  --ink: light-dark(#1d2027, #e7e3d8);
  --muted: light-dark(#5b6170, #a6a397);
  --page: light-dark(#f6f3ec, #12151b);
  --panel: light-dark(#ffffff, #1a1e26);
  --edge: light-dark(#ddd6c6, #2c313c);
  --code: light-dark(#efe9dc, #232833);
  accent-color: var(--sea);
  scrollbar-color: light-dark(#9a9384, #4a505c) transparent;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.65 system-ui, "Segoe UI", Roboto, sans-serif; }
a { color: var(--sea); text-underline-offset: 2px; }
a:hover { color: var(--brass); }
.skip { position: absolute; left: 12px; top: -48px; padding: 8px 12px; background: var(--sea-deep); color: #fff; border-radius: 6px; z-index: 10; }
.skip:focus { top: 12px; }
header.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 22px; background: linear-gradient(90deg, #0b141a, #0e2a2e); color: #e9fbfa; border-bottom: 2px solid #d6aa5c; }
header.top .brand { display: flex; align-items: baseline; gap: 8px; color: inherit; text-decoration: none; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; letter-spacing: 0.12em; text-transform: uppercase; }
header.top .brand small { font-family: system-ui, sans-serif; font-size: 0.7rem; letter-spacing: 0.08em; color: #d6aa5c; border: 1px solid #d6aa5c; border-radius: 999px; padding: 0 7px; }
header.top nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
header.top nav a { color: #e9fbfa; text-decoration: none; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 10px; border: 1px solid rgba(64, 200, 196, 0.55); border-radius: 6px; background: rgba(10, 118, 122, 0.55); }
header.top nav a:hover { background: rgba(16, 140, 144, 0.9); border-color: #d6aa5c; }
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); max-width: 1240px; margin: 0 auto; }
aside.side { position: sticky; top: 58px; align-self: start; max-height: calc(100dvh - 58px); overflow: auto; padding: 22px 14px 40px 22px; border-right: 1px solid var(--edge); }
aside.side ol { list-style: none; margin: 0; padding: 0; }
aside.side a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 0.92rem; }
aside.side a:hover { background: color-mix(in srgb, var(--sea) 14%, transparent); }
aside.side a[aria-current="page"] { background: color-mix(in srgb, var(--sea) 22%, transparent); color: var(--sea); font-weight: 700; box-shadow: inset 3px 0 0 var(--brass); }
main { padding: 30px 44px 80px; min-width: 0; }
main h1 { font-family: Georgia, "Times New Roman", serif; font-size: 2.2rem; line-height: 1.2; margin: 0 0 18px; color: var(--ink); border-bottom: 2px solid var(--brass); padding-bottom: 10px; }
main h2 { font-family: Georgia, serif; font-size: 1.5rem; margin: 2.2em 0 0.5em; color: var(--sea); }
main h3 { font-size: 1.15rem; margin: 1.8em 0 0.4em; }
main h2, main h3 { scroll-margin-top: 70px; position: relative; }
.anchor { position: absolute; left: -1.1em; opacity: 0; text-decoration: none; color: var(--muted); }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
main p, main li { max-width: 74ch; }
main li + li { margin-top: 0.25em; }
code { font: 0.88em/1.4 ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--code); padding: 0.1em 0.35em; border-radius: 4px; }
pre { background: var(--code); padding: 14px 16px; border-radius: 8px; overflow: auto; border: 1px solid var(--edge); }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; margin: 1em 0; width: 100%; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--edge); padding: 7px 10px; text-align: left; vertical-align: top; }
th { background: color-mix(in srgb, var(--sea) 14%, var(--panel)); }
tr:nth-child(even) td { background: color-mix(in srgb, var(--edge) 25%, transparent); }
blockquote { margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--brass); background: color-mix(in srgb, var(--brass) 10%, transparent); border-radius: 0 8px 8px 0; }
figure { margin: 1.4em 0; }
figure img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--edge); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25); }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 50px; padding-top: 18px; border-top: 1px solid var(--edge); }
.pager a { display: block; padding: 10px 14px; border: 1px solid var(--edge); border-radius: 8px; text-decoration: none; background: var(--panel); max-width: 48%; }
.pager small { display: block; color: var(--muted); }
footer.foot { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 26px; border-top: 1px solid var(--edge); }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  aside.side { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--edge); padding: 14px 16px; }
  aside.side ol { display: flex; flex-wrap: wrap; gap: 4px; }
  aside.side a { padding: 4px 9px; border: 1px solid var(--edge); font-size: 0.85rem; }
  main { padding: 22px 16px 60px; }
  header.top { flex-wrap: wrap; padding: 10px 16px; }
  header.top nav { margin-left: 0; }
}
