:root {
  --bg: #070a12; --bg2: #0b1020; --panel: #0d1324; --panel2: #111a30; --line: rgba(122, 156, 255, .14); --line2: rgba(122, 156, 255, .28);
  --text: #e8ecff; --muted: #8d96b8; --dim: #5d6688;
  --teal: #3ee6c4; --violet: #8b7bff; --blue: #5aa8ff; --amber: #ffb547; --red: #ff5d6c;
  --display: "Unbounded", "Instrument Sans", system-ui, sans-serif; --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.08; }
h2 { font-size: 22px; }
h3 { font-size: 15px; letter-spacing: .02em; }
.bg-grid { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); opacity: .55; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 14px max(16px, calc(50% - 560px));
  background: rgba(7, 10, 18, .82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-size: 16px; font-weight: 500; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--teal); font-weight: 600; }
.mark { width: 26px; height: 26px; color: var(--teal); filter: drop-shadow(0 0 8px rgba(62, 230, 196, .45)); }
#nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
#nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 500; }
#nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
#nav a.on { color: var(--text); background: var(--panel2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel);
  font-family: var(--mono); font-size: 12.5px; color: var(--text); white-space: nowrap; }
#nav .chip { margin-left: 6px; }
@media (max-width: 760px) { .top { flex-wrap: wrap; gap: 8px; } #nav { width: 100%; justify-content: flex-start; margin-left: 0; } #nav a { padding: 4px 8px; } }

main { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 28px 16px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin: 10px 0 22px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 200px; }
.sub { color: var(--muted); margin: 6px 0 0; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--panel2); color: var(--text); font: 600 14px var(--sans); cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--teal); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, #3ee6c4, #33b8e8); color: #04110e; border: 0; box-shadow: 0 0 24px rgba(62, 230, 196, .25); }
.btn.primary:hover { box-shadow: 0 0 34px rgba(62, 230, 196, .45); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
input, textarea, select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text);
  font: 14px var(--sans); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(62, 230, 196, .14); }
textarea { font: 12.5px/1.5 var(--mono); min-height: 260px; resize: vertical; tab-size: 2; }
.field { margin-bottom: 16px; }
.hint { color: var(--dim); font-size: 12.5px; margin-top: 6px; }
.err { color: var(--red); font-size: 13.5px; min-height: 20px; margin: 6px 0; white-space: pre-wrap; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { min-width: 0; }

/* panels */
.panel { position: relative; background: linear-gradient(180deg, var(--panel), rgba(13, 19, 36, .7)); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.panel.hud::before, .panel.hud::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--teal); opacity: .7; }
.panel.hud::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--r); }
.panel.hud::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--r); }
.panel h3 { margin-bottom: 14px; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .14em; font-family: var(--mono); font-weight: 500; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }

.stat .v { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.stat .k { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 500; }

/* state pills */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px; font: 500 12px var(--mono);
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 10%, transparent); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.pill.running { color: var(--teal); }
.pill.running::before { animation: pulse 2s infinite; }
.pill.starting, .pill.deploying, .pill.booting, .pill.stopping, .pill.deleting { color: var(--amber); }
.pill.starting::before, .pill.deploying::before, .pill.booting::before, .pill.stopping::before, .pill.deleting::before { animation: blink 1s infinite; }
.pill.stopped, .pill.provisioned, .pill.deleted { color: var(--muted); }
.pill.failed { color: var(--red); }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.75); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* landing */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 40px 0 26px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 560px; margin: 18px 0 26px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--teal), var(--blue) 60%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 16px; } .core-wrap { max-width: 340px; margin: 0 auto; } }
.core-wrap { position: relative; aspect-ratio: 1; width: 100%; }
.core-wrap svg { width: 100%; height: 100%; overflow: visible; }
.spin { transform-origin: 200px 200px; animation: spin 24s linear infinite; }
.spin.rev { animation-duration: 36s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.glow { filter: drop-shadow(0 0 12px rgba(62, 230, 196, .55)); }
.ticker { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 30px; color: var(--muted); font: 12.5px var(--mono); }
.ticker b { color: var(--text); font-weight: 500; }
.ticker .live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); margin-right: 8px; box-shadow: 0 0 8px var(--teal); animation: pulse 2s infinite; }
.feature .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 14px; background: rgba(62, 230, 196, .1); color: var(--teal); }
.feature .ic svg { width: 20px; height: 20px; }
.feature p { color: var(--muted); margin: 8px 0 0; font-size: 14px; }
.feature h3 { text-transform: none; letter-spacing: 0; font-family: var(--display); font-size: 15px; color: var(--text); margin: 0; }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 10px 0; }
.flow .st { position: relative; padding: 18px 16px 0 0; }
.flow .st .n { font: 500 12px var(--mono); color: var(--teal); }
.flow .st b { display: block; margin: 6px 0 4px; font-family: var(--display); font-weight: 500; font-size: 14px; }
.flow .st span { color: var(--muted); font-size: 13.5px; }
.flow .st::before { content: ""; position: absolute; top: 0; left: 0; right: 16px; height: 2px; background: linear-gradient(90deg, var(--teal), transparent); }
@media (max-width: 760px) { .flow { grid-template-columns: 1fr 1fr; gap: 12px; } }
section { margin: 46px 0; }
section > h2 { margin-bottom: 18px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--dim); font: 500 11.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }
.right { text-align: right; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.ok { color: var(--teal); }
.bad { color: var(--red); }
.warn { color: var(--amber); }
.nowrap { white-space: nowrap; }
.foot { color: var(--dim); font-size: 13px; padding: 30px 0 0; border-top: 1px solid var(--line); margin-top: 60px; display: flex; gap: 18px; flex-wrap: wrap; }

/* auth */
.auth { max-width: 420px; margin: 6vh auto 0; }
.auth h2 { margin-bottom: 6px; }
.auth .alt { margin-top: 14px; color: var(--muted); font-size: 14px; }

/* apps */
.app-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; color: var(--text); transition: border-color .15s, transform .15s; }
.app-card:hover { border-color: var(--line2); text-decoration: none; transform: translateY(-1px); }
.app-card .name { font-family: var(--display); font-size: 17px; font-weight: 500; }
.app-card .meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.app-card .url { font: 12.5px var(--mono); color: var(--teal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; grid-column: 1 / -1; }
.empty { text-align: center; padding: 56px 20px; }
.empty p { color: var(--muted); max-width: 460px; margin: 10px auto 22px; }

/* deploy */
.tpls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .tpls { grid-template-columns: 1fr; } }
.tpl { text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); cursor: pointer; font: inherit; }
.tpl b { display: block; font-weight: 600; margin-bottom: 4px; }
.tpl span { color: var(--muted); font-size: 13px; }
.tpl.on { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal), 0 0 22px rgba(62, 230, 196, .12); }
.types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.env-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 8px; margin-bottom: 8px; }
.seal-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.seal-note svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--teal); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; color: var(--muted); font-size: 14px; }
.checklist li .ck { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--dim); display: grid; place-items: center; font-size: 12px; margin-top: 1px; }
.checklist li.done { color: var(--text); }
.checklist li.done .ck { border-color: var(--teal); background: var(--teal); color: #04110e; box-shadow: 0 0 10px rgba(62, 230, 196, .5); }
.checklist li.fail { color: var(--red); }
.checklist li.fail .ck { border-color: var(--red); color: var(--red); }
.checklist li.work .ck { border-color: var(--amber); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.checklist li small { display: block; color: var(--dim); font-size: 12px; font-family: var(--mono); word-break: break-all; }

/* stepper */
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 4px 0 8px; }
.step { position: relative; padding: 16px 10px 0 0; color: var(--dim); }
.step::before { content: ""; position: absolute; top: 0; left: 0; right: 10px; height: 3px; border-radius: 3px; background: var(--line2); }
.step.done { color: var(--text); }
.step.done::before { background: var(--teal); box-shadow: 0 0 10px rgba(62, 230, 196, .55); }
.step.now { color: var(--amber); }
.step.now::before { background: linear-gradient(90deg, var(--amber), rgba(255, 181, 71, .2), var(--amber)); background-size: 200% 100%; animation: scan 1.2s linear infinite; }
.step.fail { color: var(--red); }
.step.fail::before { background: var(--red); }
@keyframes scan { to { background-position: -200% 0; } }
.step b { display: block; font-size: 13.5px; font-weight: 600; }
.step span { font: 12px var(--mono); color: var(--dim); }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; gap: 10px; } }

/* app page */
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); font-size: 13px; word-break: break-all; }
.seal { display: flex; align-items: center; gap: 16px; padding: 4px 0 14px; }
.seal svg { width: 64px; height: 64px; flex: none; }
.seal .t { font-family: var(--display); font-size: 18px; font-weight: 600; }
.seal.good .t { color: var(--teal); }
.seal.good svg { filter: drop-shadow(0 0 14px rgba(62, 230, 196, .6)); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { filter: drop-shadow(0 0 4px rgba(62, 230, 196, .3)); } }
pre.logs { background: #05070d; border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-all;
  color: #b9c3e6; margin: 10px 0 0; min-height: 80px; }
.url-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.url-row:last-child { border-bottom: 0; }
.url-row a { font: 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.events { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.events li { display: grid; grid-template-columns: 76px 100px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.events li:last-child { border-bottom: 0; }
.events .t { font: 12px var(--mono); color: var(--dim); }
details summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
details pre { background: #05070d; border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; max-height: 420px; font-size: 12px; color: #b9c3e6; }
.secret-box { background: #04110e; border: 1px solid var(--teal); border-radius: 10px; padding: 14px; font: 14px var(--mono); word-break: break-all; margin: 10px 0; box-shadow: 0 0 24px rgba(62, 230, 196, .15); }
.codeblock { position: relative; background: #05070d; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; color: #c8d1f0; }

/* network */
.miners { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.miner { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; }
.miner svg { width: 72px; height: 72px; }
.miner.on .ring { animation: spin 10s linear infinite; transform-origin: 36px 36px; }
.miner .nm { font-family: var(--display); font-weight: 500; }
.miner .facts { color: var(--muted); font-size: 12.5px; font-family: var(--mono); line-height: 1.7; }
.bar { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--blue)); border-radius: 8px; transition: width .6s; }

/* docs */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; }
.toc { position: sticky; top: 84px; font-size: 13.5px; max-height: calc(100vh - 110px); overflow: auto; }
.toc a { display: block; color: var(--muted); padding: 4px 0; }
.toc a.h3 { padding-left: 12px; font-size: 13px; }
.md { min-width: 0; }
.md h1 { font-size: 32px; margin: 0 0 14px; }
.md h2 { font-size: 21px; margin: 38px 0 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.md h3 { font-size: 15.5px; margin: 24px 0 8px; }
.md p, .md li { color: #c9d0ec; }
.md pre { background: #05070d; border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-x: auto; }
.md :not(pre) > code { background: var(--panel2); padding: 1px 6px; border-radius: 5px; color: #d6dcff; }
.md table { margin: 14px 0; font-size: 14px; }
.md blockquote { margin: 14px 0; padding: 4px 16px; border-left: 3px solid var(--teal); color: var(--muted); }
@media (max-width: 860px) { .docs { grid-template-columns: 1fr; } .toc { display: none; } }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s; z-index: 50;
  background: var(--panel2); border: 1px solid var(--line2); color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.copy { cursor: pointer; color: var(--muted); background: none; border: 1px solid var(--line2); border-radius: 7px; padding: 3px 8px; font: 12px var(--mono); }
.copy:hover { color: var(--text); border-color: var(--teal); }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.fade-in { animation: fadein .35s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
#nav a.btn.primary { color: #04110e; }
#nav a.btn.primary:hover { background: linear-gradient(135deg, #3ee6c4, #33b8e8); }
textarea { white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.kv dd .muted { font-family: var(--sans); font-size: 13.5px; word-break: normal; }
@media (max-width: 860px) { .hero .core-wrap { max-width: 240px; } }
.md table { display: block; overflow-x: auto; }
.md p, .md li { overflow-wrap: anywhere; }
.events li { grid-template-columns: 86px 100px minmax(0, 1fr); }
@media (max-width: 560px) { .events li { grid-template-columns: 70px minmax(0, 1fr); } .events li .why { grid-column: 2; } }
