/* Helonyxe Realtime — shared styles for the home page and the docs.
   Cobalt is the brand surface; signal yellow marks only things that are live
   (an event in flight, the status light). Everything else stays quiet. */
:root {
  --cobalt: #2340d9;
  --cobalt-deep: #16288f;
  --cobalt-soft: #e7ebff;
  --signal: #ffc531;
  --paper: #f5f6fa;
  --surface: #ffffff;
  --ink: #141a2e;
  --slate: #586079;
  --line: #dadfea;
  --ok: #17885b;
  --bad: #c9372f;
  --code-bg: #121833;
  --code-ink: #e3e7f7;
  --radius-s: 6px;
  --radius-l: 14px;
  --font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1222;
    --surface: #151b30;
    --ink: #e6e9f4;
    --slate: #9aa3bf;
    --line: #283150;
    --cobalt-soft: #1c2650;
    --code-bg: #0a0e1c;
    color-scheme: dark;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--cobalt); text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) { a { color: #8fa2ff; } }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  background: var(--cobalt-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 5; background: var(--cobalt); color: #fff; }
.bar .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand svg { flex: none; }
.bar nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.bar nav a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: var(--radius-s); font-size: 0.95rem; }
.bar nav a:hover { background: rgb(255 255 255 / 0.12); }
.bar nav a[aria-current='page'] { background: rgb(255 255 255 / 0.18); }
/* On phones keep the bar to one line: the brand and the two pages that matter. */
@media (max-width: 560px) {
  .bar nav a.wide { display: none; }
  .brand { font-size: 0.95rem; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 10px 20px; max-width: 100%;
  border-radius: var(--radius-s); font-weight: 600; text-decoration: none;
  border: 2px solid transparent; transition: background-color 0.15s, color 0.15s;
}
.btn-light { background: #fff; color: var(--cobalt-deep); }
.btn-light:hover { background: var(--signal); color: var(--ink); }
.btn-ghost { color: #fff; border-color: rgb(255 255 255 / 0.5); }
.btn-ghost:hover { border-color: #fff; background: rgb(255 255 255 / 0.1); }

/* Status light — the one live element besides the hero animation */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.status i { width: 10px; height: 10px; border-radius: 50%; background: #9aa3bf; flex: none; }
.status[data-state='ready'] i { background: var(--signal); box-shadow: 0 0 0 4px rgb(255 197 49 / 0.25); }
.status[data-state='down'] i { background: var(--bad); }

/* Code blocks */
.code { position: relative; margin: 1.1em 0 1.4em; }
.code pre {
  margin: 0; padding: 40px 20px 18px; overflow-x: auto;
  background: var(--code-bg); color: var(--code-ink);
  border-radius: var(--radius-s); line-height: 1.55; font-size: 0.86rem;
}
.code .lang { position: absolute; top: 11px; left: 20px; font: 0.72rem var(--mono); color: #8b93b3; }
.code button {
  position: absolute; top: 6px; right: 6px; min-height: 30px;
  font: 600 0.75rem var(--font); color: #cfd5ee; background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.15); border-radius: 5px; padding: 4px 10px; cursor: pointer;
}
.code button:hover { background: rgb(255 255 255 / 0.16); }
.tok-c { color: #7f89ad; }
.tok-s { color: #ffd77a; }
.tok-k { color: #9db0ff; }

footer.site { border-top: 1px solid var(--line); color: var(--slate); font-size: 0.9rem; padding: 28px 0 40px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

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