/* ==========================================================================
   QCS — info.qcloud.systems (public information hub)
   Same palette and type as qcloud.systems so the two sites read as one
   family; the sidebar layout keeps this one legible as a reference hub.
   ========================================================================== */

:root {
  --ink: #1a2332;
  --ink-2: #2d3e50;
  --body: #3d4a5c;
  --muted: #5a6b7a;

  --action: #0066cc;
  --action-dk: #0052a3;
  --accent: #6cc5e6;

  --surface: #ffffff;
  --page: #f0f2f5;
  --line: #e2e8f0;
  --line-soft: #eef1f5;

  --radius: 10px;
  --shadow: 0 2px 8px rgba(26, 35, 50, 0.06);
  --shadow-lift: 0 10px 28px rgba(0, 102, 204, 0.12);
  --measure: 70ch;
  --rail: 258px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--page);
  color: var(--body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--action);
}

a:hover {
  color: var(--action-dk);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 2000;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ===================== Sidebar ===================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--rail);
  height: 100vh;
  background: linear-gradient(180deg, #1a2332 0%, #243246 100%);
  border-right: 3px solid var(--accent);
  padding: 30px 20px;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-header {
  margin-bottom: 34px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(108, 197, 230, 0.28);
}

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 27px;
  font-weight: 700;
  line-height: 44px;
  text-align: center;
  margin-bottom: 14px;
  box-shadow: inset 0 0 0 2px rgba(26, 35, 50, 0.55);
}

.logo {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
  margin: 0 0 4px;
}

.tagline {
  font-size: 11px;
  color: var(--accent);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: block;
  color: #d3dde7;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.sidebar-nav a:hover {
  background: rgba(108, 197, 230, 0.16);
  color: #fff;
  padding-left: 16px;
}

.sidebar-nav a.external {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(108, 197, 230, 0.22);
  color: var(--accent);
}

/* ===================== Content ===================== */

/* Offset by the sidebar, then centre the column in whatever space is left
   rather than letting it hug the rail on a wide screen. The gutter grows
   with the viewport so the content never sits tight against the sidebar. */
.content {
  margin-left: var(--rail);
  padding: 44px clamp(40px, 5vw, 96px) 10px;
}

.content > section,
.content > .footer {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--action);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 38px 46px;
  margin-bottom: 26px;
}

section h1 {
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.3px;
}

h3 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

h3.subhead {
  margin-top: 30px;
  margin-bottom: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

p {
  margin: 0 0 16px;
  max-width: var(--measure);
}

p:last-child {
  margin-bottom: 0;
}

section ul {
  margin: 18px 0 16px 22px;
  max-width: var(--measure);
}

section li {
  margin-bottom: 8px;
}

strong {
  color: var(--ink);
}

/* ===================== Project grid ===================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
  margin: 24px 0 4px;
}

.project-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f2f6fa 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--action);
  box-shadow: var(--shadow-lift);
}

.project-card h3 {
  margin-bottom: 10px;
}

.project-card p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ===================== Status strip ===================== */

.status-intro {
  font-size: 14px;
  color: var(--muted);
}

.status-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  max-width: none;
}

.status-item {
  margin: 0;
  padding: 16px 18px 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #f2f6fa 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

.status-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- daily bars ---- */

.status-bars {
  display: flex;
  align-items: stretch;
  gap: 1px;
  height: 30px;
  margin-top: 14px;
}

.status-bar {
  flex: 1 1 0;
  min-width: 1px;
  border-radius: 1px;
  background: #dde3ea;
  transition: background 0.15s ease;
}

.status-bar[data-state="ok"] {
  background: #4caf87;
}

.status-bar[data-state="warn"] {
  background: #e0a200;
}

.status-bar[data-state="bad"] {
  background: #d14343;
}

.status-bar:hover {
  filter: brightness(0.85);
}

.status-bars[data-history="none"] {
  opacity: 0.45;
}

.status-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: #93a1b0;
}

/* ---- legend ---- */

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  max-width: none;
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-key {
  width: 9px;
  height: 14px;
  border-radius: 1px;
  background: #dde3ea;
  display: inline-block;
}

.status-key[data-state="ok"] {
  background: #4caf87;
}

.status-key[data-state="warn"] {
  background: #e0a200;
}

.status-key[data-state="bad"] {
  background: #d14343;
}

.status-name {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.status-name:hover {
  color: var(--action);
  text-decoration: underline;
}

.status-text {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #c3ccd6;
  box-shadow: 0 0 0 3px rgba(195, 204, 214, 0.25);
}

/* Colour is paired with the text label beside it, so the state is never
   communicated by hue alone. */
.status-dot[data-state="ok"] {
  background: #2e9e6b;
  box-shadow: 0 0 0 3px rgba(46, 158, 107, 0.2);
}

.status-dot[data-state="warn"] {
  background: #d08700;
  box-shadow: 0 0 0 3px rgba(208, 135, 0, 0.2);
}

.status-dot[data-state="bad"] {
  background: #d14343;
  box-shadow: 0 0 0 3px rgba(209, 67, 67, 0.2);
}

.status-dot[data-state="info"] {
  background: var(--action);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.status-dot[data-state="loading"],
.status-dot[data-state="unknown"] {
  background: #c3ccd6;
  box-shadow: 0 0 0 3px rgba(195, 204, 214, 0.25);
}

.status-checked {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* ===================== What's new ===================== */

.release-meta {
  color: var(--muted);
  font-size: 14px;
}

/* ===================== Roadmap ===================== */

.roadmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.roadmap-col {
  border-top: 3px solid var(--line);
  padding-top: 14px;
}

.roadmap-col[data-stage="in-progress"] {
  border-top-color: var(--action);
}

.roadmap-col[data-stage="planned"] {
  border-top-color: var(--accent);
}

.roadmap-col[data-stage="shipped"] {
  border-top-color: #2e9e6b;
}

.roadmap-item {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.roadmap-item h4 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
}

.roadmap-item p,
.roadmap-empty {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* ===================== Articles ===================== */

.post-list time {
  color: var(--muted);
  font-size: 13px;
  margin-left: 6px;
}

/* ===================== FAQ ===================== */

.faq details {
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 0;
  max-width: var(--measure);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

.faq details p {
  margin: 10px 0 0;
}

/* ===================== Long-form pages ===================== */

.prose h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
}

.prose h3 {
  margin-top: 20px;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 32px 0;
}

.prose code {
  font-size: 0.9em;
  background: var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
}

.prose pre {
  background: var(--ink);
  color: #e6edf5;
  border-radius: 8px;
  padding: 16px 18px;
  margin: 0 0 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.prose table {
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 14px;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}

.prose th {
  background: var(--line-soft);
  color: var(--ink);
}

.prose blockquote {
  border-left: 4px solid var(--accent);
  background: rgba(108, 197, 230, 0.09);
  margin: 0 0 18px;
  padding: 12px 18px;
  border-radius: 0 8px 8px 0;
}

.prose blockquote p {
  margin: 0;
}

.prose ol {
  margin: 18px 0 16px 22px;
  max-width: var(--measure);
}

.prose kbd {
  font-family: inherit;
  font-size: 0.85em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  background: var(--surface);
}

/* ===================== Engineering notes ===================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.notes-tools {
  margin: 24px 0 8px;
}

.notes-search input {
  width: 100%;
  max-width: 520px;
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.notes-search input:focus {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-chip {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--body);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.tag-chip:hover {
  border-color: var(--action);
  color: var(--action);
}

.tag-chip[aria-current="true"] {
  background: var(--action);
  border-color: var(--action);
  color: #fff;
}

.tag-chip-sm {
  padding: 2px 9px;
  font-size: 12px;
}

.tag-count {
  opacity: 0.65;
  margin-left: 2px;
}

.notes-status {
  min-height: 1em;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 0;
}

.note-card[hidden] {
  display: none;
}

.note-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.note-card h3 a:hover {
  color: var(--action);
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.byline {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

.note-tags {
  margin-bottom: 22px;
}

.note .toc {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0 0 28px;
  max-width: var(--measure);
}

.note .toc-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 8px;
}

.note .toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.note .toc li {
  margin: 4px 0;
  font-size: 14px;
}

.note .toc .toc-l3 {
  padding-left: 16px;
}

.prose pre.has-copy {
  position: relative;
  padding-right: 76px;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  color: #e6edf5;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  cursor: pointer;
}

.copy-btn:hover,
.copy-btn:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.heading-anchor {
  margin-left: 8px;
  color: var(--line);
  text-decoration: none;
  font-weight: 400;
}

h2:hover > .heading-anchor,
h3:hover > .heading-anchor,
.heading-anchor:focus {
  color: var(--action);
}

.related,
.author-box {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.related h2 {
  margin-top: 0;
}

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.author-box .brand-mark {
  flex: 0 0 44px;
  margin: 0;
}

.author-box p {
  margin: 0 0 4px;
}

.author-name {
  font-weight: 700;
  color: var(--ink);
}

.author-role,
.author-bio {
  font-size: 14px;
  color: var(--muted);
}

.author-box a {
  font-size: 14px;
  font-weight: 600;
}

.breadcrumb {
  font-size: 14px;
  margin-bottom: 20px;
}

.fineprint {
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted);
}

/* ===================== Callout ===================== */

.callout {
  margin-top: 30px;
  padding: 24px 26px;
  background: rgba(108, 197, 230, 0.09);
  border: 1px solid rgba(108, 197, 230, 0.4);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.callout h3 {
  margin-bottom: 8px;
}

.callout p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* ===================== Buttons ===================== */

.actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  max-width: none;
}

.btn,
.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--action);
  border: 2px solid var(--action);
  color: #fff;
}

.btn-primary:hover {
  background: var(--action-dk);
  border-color: var(--action-dk);
  color: #fff;
  box-shadow: var(--shadow-lift);
}

.btn-quiet {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: 2px solid var(--line);
  color: var(--action);
}

.btn-quiet:hover {
  border-color: var(--action);
  background: rgba(0, 102, 204, 0.05);
}

/* ===================== Footer ===================== */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding: 26px 0 40px;
  text-align: center;
  background: none;
  box-shadow: none;
  border-left: none;
  border-radius: 0;
}

.footer-links {
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--action);
}

.footer-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  max-width: none;
}

/* ===================== Responsive ===================== */

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 3px solid var(--accent);
    padding: 20px 20px 16px;
  }

  .sidebar-header {
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  .brand-mark {
    display: inline-block;
    vertical-align: middle;
    margin: 0 12px 0 0;
  }

  .logo {
    display: inline-block;
    vertical-align: middle;
  }

  .tagline {
    margin-top: 6px;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sidebar-nav a:hover {
    padding-left: 12px;
  }

  .sidebar-nav a.external {
    margin-top: 0;
    padding-top: 10px;
    border-top: none;
  }

  .content {
    margin-left: 0;
    padding: 24px 16px 6px;
  }

  section {
    padding: 24px 20px;
  }

  section h1 {
    font-size: 21px;
  }
}
