/* Clearsky website. Plain CSS, no build step, light and dark from the system setting. */
:root {
  color-scheme: light dark;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-2: #0ea5e9;
  --accent-ink: #ffffff;
  --code: #0f172a;
  --code-text: #e2e8f0;
  --inline-code: #eef2f7;
  --ok: #16a34a;
  --sky: linear-gradient(180deg, #dbeafe 0%, #eff6ff 45%, var(--bg) 100%);
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 12px 40px -12px rgba(15, 23, 42, .18);
  --radius: 14px;
  --wide: 1120px;
  --narrow: 760px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --surface: #121826;
    --surface-2: #182033;
    --text: #f1f5f9;
    --text-2: #cbd5e1;
    --muted: #94a3b8;
    --line: #232c3d;
    --accent: #6ea8ff;
    --accent-2: #38bdf8;
    --accent-ink: #0b0f17;
    --code: #070a10;
    --code-text: #e2e8f0;
    --inline-code: #1c2436;
    --ok: #4ade80;
    --sky: linear-gradient(180deg, #102040 0%, #0d1526 45%, var(--bg) 100%);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 48px -16px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }
code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
:not(pre) > code { font-size: .88em; background: var(--inline-code); padding: .12em .4em; border-radius: 5px; word-break: break-word; }
pre {
  background: var(--code); color: var(--code-text); border-radius: 10px; padding: 16px 18px;
  overflow-x: auto; font-size: 13.5px; line-height: 1.6; margin: 16px 0;
}
pre code { background: none; padding: 0; color: inherit; }
kbd { font-size: .82em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .in { max-width: var(--wide); margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; }
.top nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.top nav a { color: var(--text-2); text-decoration: none; font-size: 14.5px; padding: 6px 10px; border-radius: 8px; }
.top nav a:hover { color: var(--text); background: var(--surface-2); }
.top nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.top nav a.gh { display: inline-flex; align-items: center; gap: 6px; }
.top nav a.gh svg { width: 18px; height: 18px; fill: currentColor; }
@media (max-width: 640px) {
  .top .in { gap: 10px; }
  .top nav a { padding: 6px 7px; font-size: 14px; }
  .top nav a.gh span { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px;
  font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid transparent; white-space: nowrap;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { color: var(--text); border-color: var(--line); background: var(--surface); }
.btn.ghost:hover { border-color: var(--muted); }

/* Landing */
.hero { background: var(--sky); padding: 72px 20px 0; text-align: center; overflow: hidden; }
.hero .eyebrow { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--surface); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.08; letter-spacing: -.03em; margin: 0 auto 18px; max-width: 880px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--text-2); max-width: 680px; margin: 0 auto 28px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.hero .cmd { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; color: var(--muted); margin-bottom: 48px; }
.hero .cmd b { color: var(--text); font-weight: 500; }
.shot { display: block; margin: 0 auto; max-width: var(--wide); border-radius: 12px 12px 0 0; border: 1px solid var(--line); border-bottom: 0; box-shadow: var(--shadow); background: var(--surface); }
.shot img { display: block; width: 100%; border-radius: 12px 12px 0 0; }

.section { padding: 88px 20px; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section .in { max-width: var(--wide); margin: 0 auto; }
.section h2 { font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; }
.section .sub { color: var(--text-2); font-size: 18px; max-width: 700px; margin: 0 0 40px; }
.center { text-align: center; }
.center .sub { margin-left: auto; margin-right: auto; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.section.alt .card { background: var(--bg); }
.card h3 { margin: 14px 0 6px; font-size: 18px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--text-2); font-size: 15.5px; }
.icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.feature { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: center; margin: 0 0 96px; }
.feature:last-child { margin-bottom: 0; }
.feature.flip { grid-template-columns: 7fr 5fr; }
.feature.flip .text { order: 2; }
.feature h3 { font-size: clamp(22px, 2.8vw, 28px); letter-spacing: -.02em; line-height: 1.2; margin: 0 0 12px; }
.feature p { color: var(--text-2); margin: 0 0 12px; }
.feature ul { margin: 12px 0 0; padding: 0; list-style: none; }
.feature li { position: relative; padding-left: 26px; margin: 8px 0; color: var(--text-2); }
.feature li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 12px; height: 7px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.feature .tag { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 8px; }
.frame { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; background: var(--surface); }
.frame img { display: block; width: 100%; }

.doors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 8px; }
.door { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.door b { display: block; margin-bottom: 2px; }
.door span { color: var(--text-2); font-size: 15px; }
.door .k { flex: none; font: 600 12px ui-monospace, monospace; padding: 3px 8px; border-radius: 6px; margin-top: 2px; }
.k.go { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.k.ask { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #b45309; }
@media (prefers-color-scheme: dark) { .k.ask { color: #fbbf24; } }

.start { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.start pre { margin: 0; font-size: 14px; }
.start pre .c { color: #7c8aa3; }

.footer { border-top: 1px solid var(--line); padding: 32px 20px; color: var(--muted); font-size: 14px; }
.footer .in { max-width: var(--wide); margin: 0 auto; display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.footer a { color: var(--text-2); text-decoration: none; margin-left: 16px; }
.footer a:first-child { margin-left: 0; }
.footer a:hover { color: var(--text); }

@media (max-width: 900px) {
  .pillars { grid-template-columns: 1fr; }
  .feature, .feature.flip, .start { grid-template-columns: 1fr; gap: 28px; }
  .feature.flip .text { order: 0; }
  .feature { margin-bottom: 64px; }
  .doors { grid-template-columns: 1fr; }
  .section { padding: 64px 20px; }
}
@media (max-width: 560px) {
  .hero { padding: 48px 16px 0; }
  .section { padding: 52px 16px; }
  .shot { border-radius: 8px 8px 0 0; }
}

/* Docs pages: a side menu and the article */
.docs { max-width: var(--wide); margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; }
.side { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; padding: 32px 0; font-size: 14.5px; }
.side h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 22px 0 8px; }
.side h4:first-child { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 4px 10px; margin-left: -10px; border-radius: 7px; color: var(--text-2); text-decoration: none; }
.side li a:hover { color: var(--text); background: var(--surface-2); }
.side li a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
.side ul.toc li a { font-size: 13.5px; padding-left: 20px; }

article { padding: 40px 0 80px; min-width: 0; max-width: var(--narrow); }
article h1 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -.025em; line-height: 1.15; margin: 0 0 14px; }
article h2 { font-size: 24px; letter-spacing: -.015em; margin: 52px 0 12px; padding-top: 20px; border-top: 1px solid var(--line); }
article h3 { font-size: 18.5px; margin: 32px 0 8px; }
article h4 { font-size: 16px; margin: 24px 0 6px; }
article p, article li { color: var(--text-2); }
article strong { color: var(--text); }
article li { margin: 6px 0; }
article .lead { font-size: 19px; color: var(--text-2); }
article h2 a.anchor, article h3 a.anchor { color: var(--muted); text-decoration: none; opacity: 0; margin-left: 6px; font-weight: 400; }
article h2:hover a.anchor, article h3:hover a.anchor { opacity: 1; }
article img { display: block; margin: 20px auto; border-radius: 10px; }
article .frame { margin: 24px 0; }
article .table { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 10px; }
article table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
article th, article td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
article tr:last-child td { border-bottom: 0; }
article th { background: var(--surface-2); color: var(--text); font-weight: 600; }
article td { color: var(--text-2); }
article blockquote { margin: 16px 0; padding: 4px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; }
.edit { margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.edit a { color: var(--muted); }

/* Getting started steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 32px 0 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 8px 56px; margin: 0 0 28px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--accent-ink); background: var(--accent);
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 40px; bottom: -24px; width: 2px; background: var(--line); }
.steps > li > h2 { border: 0; padding: 0; margin: 0 0 8px; font-size: 21px; }
.note { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px 16px; font-size: 15px; color: var(--text-2); margin: 16px 0; }
.note b { color: var(--text); }
.os { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.os div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--surface); font-size: 14.5px; color: var(--text-2); }
.os b { display: block; color: var(--text); }
.next { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 20px; }
.next a { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--surface); }
.next a:hover { border-color: var(--accent); }
.next a b { color: var(--text); display: block; }
.next a span { color: var(--text-2); font-size: 14.5px; }

.menu-toggle { display: none; }
@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; gap: 0; padding: 0 16px; }
  .side { position: static; max-height: none; padding: 16px 0 0; }
  .side details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
  .side summary { cursor: pointer; font-weight: 600; font-size: 15px; }
  article { padding-top: 24px; }
  .os, .next { grid-template-columns: 1fr; }
  .steps > li { padding-left: 48px; }
}
@media (min-width: 901px) {
  .side details > summary { display: none; }
}
