/* Shared styles for the website's secondary pages (What's new, Help). The home page has its own inline styles. */
:root {
  --bg: #0f1115; --surface: #181b21; --raised: #20242c; --outline: #2c313a;
  --text: #eceef2; --dim: #9aa1ad; --amber: #f5a623; --qc: #4cc3ff; --wh: #e5304a;
}
* { box-sizing: border-box; }
/* The footer sits at the bottom of the window even when a page is short (Help). */
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
       font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--qc); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 780px; }

header.top { border-bottom: 1px solid var(--outline); background: #0c0e12cc; position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 5; }
header.top .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
header.top .brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
header.top img { width: 36px; height: 36px; }
header.top b { font-size: 20px; }
header.top nav { margin-left: auto; display: flex; gap: 22px; }
header.top nav a { color: var(--dim); text-decoration: none; font-weight: 600; font-size: 14px; }
header.top nav a:hover, header.top nav a[aria-current] { color: var(--text); }
@media (max-width: 640px) { header.top nav { gap: 16px; min-width: 0; overflow-x: auto; scrollbar-width: none; } header.top nav a { white-space: nowrap; } }

main { padding: 48px 0 72px; }
h1 { font-size: 36px; margin: 0 0 6px; }
.lead { color: var(--dim); font-size: 18px; margin: 0 0 36px; }
code { background: var(--raised); border: 1px solid var(--outline); border-radius: 6px; padding: 1px 6px; font-size: 14px; }

/* What's new */
.release { background: var(--surface); border: 1px solid var(--outline); border-radius: 14px; padding: 22px 26px; margin-bottom: 18px; }
.release h2 { display: inline-block; margin: 0; font-size: 22px; color: var(--amber); }
.release .date { display: inline-block; margin-left: 12px; color: var(--dim); font-size: 14px; }
.release ul { margin: 12px 0 0; padding-left: 20px; }
.release li { margin: 6px 0; }
.release:first-of-type { border-color: #f5a62366; box-shadow: 0 20px 60px -40px rgba(245,166,35,.45); }

/* Help */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 8px 0 36px; }
.option { display: block; background: var(--surface); border: 1px solid var(--outline); border-radius: 14px; padding: 22px;
          color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.option:hover { border-color: var(--amber); transform: translateY(-2px); }
.option h3 { margin: 0 0 6px; font-size: 18px; }
.option p { margin: 0; color: var(--dim); font-size: 15px; }
.option .go { display: inline-block; margin-top: 12px; color: var(--amber); font-weight: 700; font-size: 14px; }
h2.section { font-size: 22px; margin: 40px 0 12px; }
.faq details { background: var(--surface); border: 1px solid var(--outline); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { color: var(--dim); margin: 10px 0 0; }

footer { margin-top: auto; border-top: 1px solid var(--outline); padding: 32px 0 48px; color: var(--dim); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }

/* User guide */
.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; }
.toc { position: sticky; top: 88px; align-self: start; padding-top: 52px; display: flex; flex-direction: column; gap: 2px;
       max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain; }
.toc b { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.toc a { color: var(--dim); text-decoration: none; font-size: 14px; padding: 5px 10px; border-left: 2px solid var(--outline); }
.toc a:hover { color: var(--text); border-left-color: var(--amber); }
.toc a.on { color: var(--text); font-weight: 600; border-left-color: var(--amber); background: #ffffff08; }   /* the section being read */
.doc { min-width: 0; max-width: 820px; }
.doc h2 { font-size: 26px; margin: 48px 0 12px; padding-top: 8px; scroll-margin-top: 80px; }
.doc h3 { font-size: 19px; margin: 32px 0 8px; scroll-margin-top: 80px; }
.doc h4 { font-size: 16px; margin: 24px 0 6px; scroll-margin-top: 80px; }
.doc hr { border: 0; border-top: 1px solid var(--outline); margin: 40px 0; }
.doc li { margin: 6px 0; }
.doc .figure img { max-width: 100%; border-radius: 12px; border: 1px solid var(--outline); box-shadow: 0 20px 60px -30px #000; }
.doc blockquote { margin: 18px 0; padding: 12px 18px; background: var(--surface); border-left: 3px solid var(--amber); border-radius: 0 10px 10px 0; }
.doc blockquote p { margin: 6px 0; }
.doc .table { overflow-x: auto; margin: 16px 0; border: 1px solid var(--outline); border-radius: 12px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--outline); }
.doc th { background: var(--raised); }
.doc tr:last-child td { border-bottom: 0; }
.code { position: relative; margin: 14px 0; }
.code pre { margin: 0; background: #0a0c10; border: 1px solid var(--outline); border-radius: 10px; padding: 14px 80px 14px 16px; overflow-x: auto; }
.code pre code { background: none; border: 0; padding: 0; font-size: 13.5px; }
.code .copy { position: absolute; top: 8px; right: 8px; background: var(--raised); color: var(--text); border: 1px solid var(--outline);
              border-radius: 6px; padding: 3px 10px; font: 600 12px inherit; cursor: pointer; }
/* Phones and narrow windows: a bar under the header with the section being read; it opens a full-screen sheet */
.toc-bar { display: none; }
.toc-sheet { position: fixed; inset: 0; z-index: 100; background: #0c0e12; display: flex; flex-direction: column;
             padding-top: env(safe-area-inset-top, 0px); }
.toc-sheet[hidden] { display: none; }
.toc-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--outline); }
.toc-sheet-head b { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.toc-close { background: var(--raised); color: var(--text); border: 1px solid var(--outline); border-radius: 8px; width: 40px; height: 40px;
             font-size: 18px; line-height: 1; cursor: pointer; }
.toc-sheet nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
                 display: flex; flex-direction: column; padding: 6px 0 calc(20px + env(safe-area-inset-bottom, 0px)); }
.toc-sheet nav a { color: var(--dim); text-decoration: none; font-size: 16px; padding: 13px 24px; border-left: 3px solid transparent; }
.toc-sheet nav a.on { color: var(--text); font-weight: 600; border-left-color: var(--amber); background: #ffffff08; }
@media (max-width: 900px) {
  .guide { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .toc-bar { display: block; position: sticky; top: 65px; z-index: 4; margin: 0 -24px; background: #0c0e12; border-bottom: 1px solid var(--outline); }
  .toc-open { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 24px; background: none; border: 0; color: inherit;
              font: inherit; text-align: left; cursor: pointer; }
  .toc-open b { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
  .toc-open .cur { flex: 1; min-width: 0; color: var(--text); font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toc-open .chev { color: var(--amber); font-size: 18px; line-height: 1; }
  .doc h2, .doc h3, .doc h4 { scroll-margin-top: 124px; }
}
}
.doc .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.doc .pair figure { margin: 0; }
.doc .pair img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--outline); }
.doc .pair figcaption { color: var(--dim); font-size: 14px; margin-top: 8px; text-align: center; }
@media (max-width: 640px) { .doc .pair { grid-template-columns: 1fr; } }
