/* =====================================================================
   Snooba Cloud Open Source Mirror
   One stylesheet, no framework, no external fonts, no webfont requests.
   Dark first, with a light theme and an explicit user override.
   ===================================================================== */

:root {
  color-scheme: dark light;

  --bg:          #080b10;
  --bg-elev:     #0d1117;
  --surface:     #111823;
  --surface-2:   #161f2c;
  --border:      #1e2836;
  --border-soft: #172030;

  --text:        #e8eef7;
  --text-dim:    #a3b0c2;
  --text-muted:  #6b7a8f;

  --accent:      #3ba9f0;
  --accent-dim:  #1d7fc4;
  --accent-glow: rgba(59,169,240,.13);

  --ok:    #35d29a;
  --warn:  #f0b429;
  --crit:  #f2686b;
  --idle:  #566274;

  --radius:    14px;
  --radius-sm: 9px;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono",
          "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px -12px rgba(0,0,0,.6);
  --maxw: 1180px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg:          #f4f7fb;
  --bg-elev:     #ffffff;
  --surface:     #ffffff;
  --surface-2:   #f7fafd;
  --border:      #dde5ef;
  --border-soft: #e8eef6;
  --text:        #0d1826;
  --text-dim:    #47566b;
  --text-muted:  #74839a;
  --accent:      #0a72bd;
  --accent-dim:  #085a97;
  --accent-glow: rgba(10,114,189,.09);
  --ok:    #0e9c6d;
  --warn:  #b0770a;
  --crit:  #cf3b3f;
  --idle:  #93a0b2;
  --shadow: 0 1px 2px rgba(16,32,56,.06), 0 10px 30px -16px rgba(16,32,56,.22);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg:          #f4f7fb;
    --bg-elev:     #ffffff;
    --surface:     #ffffff;
    --surface-2:   #f7fafd;
    --border:      #dde5ef;
    --border-soft: #e8eef6;
    --text:        #0d1826;
    --text-dim:    #47566b;
    --text-muted:  #74839a;
    --accent:      #0a72bd;
    --accent-dim:  #085a97;
    --accent-glow: rgba(10,114,189,.09);
    --ok:    #0e9c6d;
    --warn:  #b0770a;
    --crit:  #cf3b3f;
    --idle:  #93a0b2;
    --shadow: 0 1px 2px rgba(16,32,56,.06), 0 10px 30px -16px rgba(16,32,56,.22);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 18px;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 640; letter-spacing: -.01em; }
.brand svg { display: block; }
.brand .b-name { color: var(--text); font-size: 15.5px; }
.brand .b-sub {
  color: var(--text-muted); font-size: 11px; font-family: var(--mono);
  letter-spacing: .06em; text-transform: uppercase;
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--text-dim); font-size: 13.5px; padding: 7px 12px;
  border-radius: 8px; text-decoration: none; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.is-active { color: var(--text); background: var(--surface-2); }

.theme-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; margin-left: 4px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text-dim);
  cursor: pointer; padding: 0;
}
.theme-btn:hover { color: var(--text); border-color: var(--accent-dim); }
.theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: block; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-btn .i-moon { display: none; }
}

/* ---------------- hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
  padding: 74px 0 62px;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(900px 380px at 22% -8%, var(--accent-glow), transparent 70%),
    linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--border-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-soft) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(760px 320px at 26% 0%, #000 10%, transparent 78%);
  mask-image: radial-gradient(760px 320px at 26% 0%, #000 10%, transparent 78%);
  opacity: .5; pointer-events: none;
}
.hero .wrap { position: relative; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 13px 5px 9px; background: var(--surface);
}
.hero h1 {
  margin: 20px 0 0;
  font-size: clamp(30px, 5.2vw, 47px);
  line-height: 1.1; letter-spacing: -.028em; font-weight: 660;
}
.hero .lede {
  margin: 16px 0 0; max-width: 62ch;
  color: var(--text-dim); font-size: 16.5px;
}

.facts {
  display: grid; gap: 1px; margin-top: 38px;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden;
}
.fact { background: var(--bg-elev); padding: 15px 17px; }
.fact dt {
  font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-muted); font-family: var(--mono); margin: 0 0 5px;
}
.fact dd {
  margin: 0; font-size: 15px; font-weight: 560; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.fact dd.mono { font-family: var(--mono); font-size: 14px; font-weight: 500; }

/* ---------------- sections ---------------- */
.section { padding: 62px 0; }
.section + .section { border-top: 1px solid var(--border-soft); }
.section-head { margin-bottom: 26px; }
.section-head h2 {
  margin: 0; font-size: 21px; letter-spacing: -.015em; font-weight: 630;
}
.section-head p { margin: 7px 0 0; color: var(--text-muted); font-size: 14px; max-width: 72ch; }

/* ---------------- repository cards ---------------- */
.repos { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
.repo {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 19px 20px 17px;
  display: flex; flex-direction: column; gap: 13px;
  transition: border-color .15s ease, transform .15s ease;
}
.repo:hover { border-color: var(--accent-dim); }
.repo.is-off { opacity: .62; }
.repo-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.repo-name { font-size: 16px; font-weight: 620; letter-spacing: -.01em; }
.repo-home { font-size: 11.5px; color: var(--text-muted); font-family: var(--mono); }
.repo-home a { color: var(--text-muted); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.s-online   { color: var(--ok);   background: color-mix(in srgb, var(--ok) 12%, transparent);   border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.badge.s-syncing  { color: var(--accent); background: var(--accent-glow); border-color: color-mix(in srgb, var(--accent) 32%, transparent); }
.badge.s-degraded,
.badge.s-stale    { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge.s-pending  { color: var(--text-dim); background: var(--surface-2); border-color: var(--border); }
.badge.s-not_enabled { color: var(--idle); background: var(--surface-2); border-color: var(--border); }
.badge.s-syncing .dot { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

.repo-meta { display: grid; gap: 7px; font-size: 13px; }
.repo-meta div { display: flex; justify-content: space-between; gap: 14px; }
.repo-meta dt, .repo-meta .k { color: var(--text-muted); }
.repo-meta .v { color: var(--text-dim); font-family: var(--mono); font-size: 12.5px;
                font-variant-numeric: tabular-nums; text-align: right; }
.repo-link {
  margin-top: auto; padding-top: 13px; border-top: 1px solid var(--border-soft);
  font-family: var(--mono); font-size: 12.5px; word-break: break-all;
}
.repo-link span { color: var(--text-muted); }

/* ---------------- stat tiles ---------------- */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 17px 19px;
}
.tile .t-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 9px;
  display: flex; align-items: center; gap: 7px;
}
.tile .t-value {
  font-size: 27px; font-weight: 620; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.tile .t-unit { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.tile .t-sub { margin-top: 5px; font-size: 12.5px; color: var(--text-muted); }
.tile.is-live .t-label::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok); animation: pulse 2s ease-in-out infinite;
}

/* ---------------- chart ---------------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 15px 19px; border-bottom: 1px solid var(--border-soft);
}
.panel-head h3 { margin: 0; font-size: 14.5px; font-weight: 620; }
.panel-head .p-sub { color: var(--text-muted); font-size: 12.5px; }
.seg { margin-left: auto; display: flex; gap: 2px; background: var(--surface-2);
       border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--text-muted);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em;
  padding: 5px 11px; border-radius: 7px; cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"] { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }
.chart-box { padding: 16px 12px 10px; }
.chart-box svg { display: block; width: 100%; height: auto; }
.chart-empty {
  padding: 46px 20px; text-align: center; color: var(--text-muted); font-size: 13.5px;
}

/* ---------------- per project bars ---------------- */
.pbars { display: grid; gap: 13px; }
.pbar-row { display: grid; gap: 6px; }
.pbar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
.pbar-top .n { font-weight: 560; }
.pbar-top .v { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim);
               font-variant-numeric: tabular-nums; }
.pbar-track { height: 7px; border-radius: 999px; background: var(--surface-2);
              border: 1px solid var(--border-soft); overflow: hidden; }
.pbar-fill { height: 100%; border-radius: 999px;
             background: linear-gradient(90deg, var(--accent-dim), var(--accent)); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-soft); }
table.data th {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); font-weight: 600;
}
table.data td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }

/* ---------------- info grid / notes ---------------- */
.cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 21px;
}
.card h3 { margin: 0 0 11px; font-size: 14.5px; font-weight: 620; }
.card p  { margin: 0 0 10px; color: var(--text-dim); font-size: 13.5px; }
.card p:last-child { margin-bottom: 0; }
.card ul { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: 13.5px; }
.card li { margin-bottom: 6px; }
.card li:last-child { margin-bottom: 0; }

code, kbd, pre {
  font-family: var(--mono); font-size: 12.5px;
}
code {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 6px; padding: 1.5px 6px; color: var(--text-dim);
}
pre {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 13px 15px; overflow-x: auto;
  margin: 0; color: var(--text-dim); line-height: 1.55;
}

.note {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 13px 15px;
  font-size: 13px; color: var(--text-dim);
}
.note svg { flex: none; margin-top: 2px; color: var(--text-muted); }

/* ---------------- footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border-soft); padding: 34px 0 44px;
  color: var(--text-muted); font-size: 13px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.site-footer .f-links { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--text-dim); }

.updated { font-family: var(--mono); font-size: 11.5px; color: var(--text-muted); }

/* ---------------- responsive ---------------- */
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 48px 0 42px; }
  .section { padding: 44px 0; }
  .site-header .wrap { height: 56px; gap: 10px; }
  .nav a { padding: 7px 9px; font-size: 13px; }
  .brand .b-sub { display: none; }
  .tile .t-value { font-size: 23px; }
  .site-footer .f-links { margin-left: 0; width: 100%; }
}
@media (max-width: 400px) {
  .nav a[data-optional] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
