/* Bleeps website - the page itself.

   The colours come from the logo: the blue of the waves and the yellow of "Bleeps". Every colour is named
   here once, and once more for a dark screen. */
:root{
  --bg:      #f3f7fc;
  --paper:   #ffffff;
  --ink:     #0f1b2d;
  --muted:   #55657a;
  --line:    #dbe4ef;
  --soft:    #eaf2fb;
  --blue:    #1466c4;   /* text-safe version of the logo's waves */
  --cyan:    #1f9be8;
  --yellow:  #ffc21a;   /* the logo's "Bleeps" */
  --yellow-ink: #1a1300;
  --navy:    #0a1730;
  --code-bg: #eaf1f9;
  --code-line: #d6e2f0;
  --shadow:  rgba(15,27,45,.08);
  --maxw:    1180px;
  --radius:  12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:      #0b1220;
    --paper:   #121b2c;
    --ink:     #e6edf7;
    --muted:   #9aabc2;
    --line:    #24324a;
    --soft:    #18243a;
    --blue:    #5aa9f5;
    --cyan:    #8cc8ff;
    --navy:    #060c18;
    --code-bg: #18243a;
    --code-line: #2a3a56;
    --shadow:  rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

*{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}
img{ max-width: 100%; height: auto; }
a{ color: var(--blue); }
a:hover{ color: var(--cyan); }
code, kbd, pre{ font-family: Consolas, "Cascadia Mono", Menlo, monospace; }
code{ background: var(--code-bg); border: 1px solid var(--code-line); border-radius: 4px; padding: 0 .3em; font-size: .9em; overflow-wrap: anywhere; }
pre{
  background: var(--code-bg); border: 1px solid var(--code-line); border-radius: 8px; padding: 12px 14px;
  overflow-x: auto; font-size: .85rem; line-height: 1.5; margin: 0 0 16px;
}
pre code{ background: none; border: 0; padding: 0; font-size: inherit; }
pre.bits{ white-space: pre-wrap; word-break: break-all; }
kbd{
  display: inline-block; min-width: 1.6em; padding: 0 .4em; font-size: .85em; text-align: center;
  background: var(--paper); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
}
.wrap{ max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
header.site{
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
header.site .bar{ display: flex; align-items: center; gap: 18px; height: 72px; }
.brand{ display: flex; align-items: center; }
.brand img{ width: 150px; height: auto; display: block; }
header.site nav{ margin-left: auto; display: flex; align-items: center; gap: 4px; }
header.site nav a{
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 8px 14px; border-radius: 8px;
}
header.site nav a:hover{ background: var(--soft); color: var(--blue); }
header.site nav a[aria-current="page"]{ color: var(--blue); }
header.site nav a.dl{ background: var(--yellow); color: var(--yellow-ink); margin-left: 6px; }
header.site nav a.dl:hover{ filter: brightness(1.06); }
header.site nav a.dl span:not(:empty){ opacity: .8; font-weight: 500; margin-left: 4px; }
.navtoggle{
  display: none; margin-left: auto; border: 1px solid var(--line); background: var(--paper); border-radius: 8px;
  font-size: 1.3rem; line-height: 1; padding: 8px 11px; cursor: pointer; color: var(--ink);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero{
  background:
    radial-gradient(900px 420px at 75% 0%, rgba(31,155,232,.18), transparent 70%),
    radial-gradient(700px 380px at 0% 30%, rgba(255,194,26,.14), transparent 70%),
    var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 48px 0 60px;
}
.hero-grid{ display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; align-items: center; }
.hero h1{ margin: 10px 0 14px; font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); line-height: 1.12; letter-spacing: -.01em; }
.hero h1 .accent{ color: var(--blue); }
.hero p.lead{ font-size: 1.12rem; color: var(--muted); margin: 0 0 26px; }
.hero .logo-big{ width: 100%; max-width: 520px; display: block; }
.cta{ display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn{
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600;
  border-radius: 10px; padding: 12px 20px; border: 1px solid transparent; cursor: pointer; font-size: 1rem;
}
.btn.primary{ background: var(--yellow); color: var(--yellow-ink); box-shadow: 0 8px 22px rgba(255,170,0,.28); }
.btn.primary:hover{ filter: brightness(1.06); color: var(--yellow-ink); }
.btn.ghost{ background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover{ border-color: var(--cyan); color: var(--blue); }
.btn small{ font-weight: 500; opacity: .8; }
.meta{ color: var(--muted); font-size: .88rem; margin-top: 14px; }

/* ── Sections ───────────────────────────────────────────────────────────── */
section.block{ padding: 60px 0 8px; }
section.block + section.block{ padding-top: 36px; }
.eyebrow{
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 6px;
}
section[id]{ scroll-margin-top: 80px; }
h2{ font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem); line-height: 1.2; margin: 0 0 14px; scroll-margin-top: 90px; }
h3{ font-size: 1.15rem; margin: 26px 0 8px; scroll-margin-top: 90px; }
p{ margin: 0 0 14px; }
.intro{ color: var(--muted); font-size: 1.05rem; max-width: 780px; }

.cards{ display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 18px; margin-top: 26px; }
.hero-grid > *, .feature > *, .cards > *, .docs > *{ min-width: 0; }
.card{
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px;
  text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .15s, box-shadow .15s;
}
a.card:hover{ border-color: var(--cyan); transform: translateY(-2px); box-shadow: 0 12px 30px var(--shadow); color: inherit; }
.card .ico{ font-size: 1.6rem; line-height: 1; }
.card h3{ margin: 10px 0 6px; font-size: 1.06rem; }
.card p{ margin: 0; color: var(--muted); font-size: .94rem; }
.card .more{ display: inline-block; margin-top: 10px; font-weight: 600; font-size: .9rem; color: var(--blue); }

.feature{ display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; margin: 30px 0 10px; }
.feature ul, .feature ol, .docs ul, .docs ol{ padding-left: 1.3em; margin: 0 0 14px; }
.feature li, .docs li{ margin: 4px 0; }

.steps{ counter-reset: s; list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.steps li{ counter-increment: s; position: relative; padding: 14px 16px 14px 58px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before{
  content: counter(s); position: absolute; left: 14px; top: 13px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--yellow); color: var(--yellow-ink); font-weight: 700; display: grid; place-items: center;
}

/* ── Screenshots ────────────────────────────────────────────────────────── */
figure.shot{ margin: 0; }
figure.shot img{ display: block; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 14px 40px var(--shadow); }
figure.shot figcaption{ color: var(--muted); font-size: .9rem; margin-top: 10px; }
.viewer{
  position: fixed; inset: 0; z-index: 100; background: rgba(5,10,20,.88); display: grid; place-items: center;
  padding: 24px; cursor: zoom-out;
}
.viewer img{ max-width: 100%; max-height: 100%; border-radius: 8px; }
.viewer .close{
  position: absolute; top: 14px; right: 16px; font-size: 1.4rem; background: none; border: 0; color: #fff; cursor: pointer;
}

/* ── Page head, documentation pages ─────────────────────────────────────── */
.page-head{ background: var(--paper); border-bottom: 1px solid var(--line); padding: 44px 0 0; }
.page-head h1{ margin: 6px 0 10px; font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.6rem); line-height: 1.15; }
.page-head p{ color: var(--muted); max-width: 800px; font-size: 1.05rem; }
.docs{ display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc{ position: sticky; top: 96px; padding: 50px 0 0; font-size: .92rem; }
.toc b{ display: block; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.toc ol{ list-style: none; padding: 0; margin: 0; }
.toc a{ display: block; padding: 4px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.toc a:hover{ background: var(--soft); color: var(--blue); }
.docs section.block{ padding-top: 50px; }
.docs section.block + section.block{ padding-top: 30px; }

table.facts{ width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 8px 0 18px; font-size: .95rem; }
table.facts th, table.facts td{ text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
table.facts th{ background: var(--soft); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
table.facts tr:last-child td{ border-bottom: 0; }
.scroll{ overflow-x: auto; }

.note{
  border-left: 4px solid var(--cyan); background: var(--soft); padding: 12px 16px; border-radius: 0 10px 10px 0;
  color: var(--ink); font-size: .95rem; margin: 10px 0 16px;
}
.note.warn{ border-left-color: var(--yellow); }

/* ── Download page ──────────────────────────────────────────────────────── */
.release{
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px;
  box-shadow: 0 12px 34px var(--shadow);
}
.release img{ width: 88px; }
.release .v{ font-size: 2.1rem; font-weight: 700; line-height: 1.1; }
.release .sub{ color: var(--muted); font-size: .92rem; }
.check{ margin-top: 14px; font-size: .86rem; color: var(--muted); }
.check summary{ cursor: pointer; font-weight: 600; }
.check p{ margin: 8px 0; }
.check code{ font-size: .78rem; word-break: break-all; }
.hashrow{ display: grid; grid-template-columns: 7.5em minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 6px 0; }
.hashrow .copy{ font: inherit; font-size: .78rem; padding: 2px 10px; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: inherit; }
.empty{ background: var(--paper); border: 1px dashed var(--line); border-radius: 16px; padding: 30px; text-align: center; color: var(--muted); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer.site{ background: var(--navy); color: #b8c7dc; margin-top: 70px; padding: 26px 0; font-size: .92rem; }
footer.site .foot{ display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
footer.site .foot img{ width: 40px; flex: none; }
footer.site b{ color: #fff; margin-right: 6px; }
footer.site .dev{ margin-top: 2px; font-size: .86rem; color: #8ea3bd; }
footer.site a{ color: #8fd0ff; text-decoration: none; }
footer.site a:hover{ text-decoration: underline; }

/* ── Small screens ──────────────────────────────────────────────────────── */
@media (max-width: 940px){
  .hero-grid, .feature, .docs{ grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .toc{ position: static; padding-top: 30px; }
  .toc ol{ display: flex; flex-wrap: wrap; gap: 4px; }
  .release{ grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; }
}
@media (max-width: 760px){
  .wrap{ padding: 0 16px; }
  .navtoggle{ display: block; }
  header.site nav{
    display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 16px 14px;
  }
  header.site nav.open{ display: flex; }
  header.site nav a.dl{ margin: 6px 0 0; text-align: center; }
  .hashrow{ grid-template-columns: minmax(0, 1fr) auto; }
  .hashrow span{ grid-column: 1 / -1; }
  section.block{ padding-top: 44px; }
}
