:root {
  --ink: #080a0d;
  --panel: #0e1117;
  --panel2: #12161d;
  --elev: #181d25;
  --body: #c4cad3;
  --muted: #8c96a5;
  --dim: #5d6674;
  --line: #242a35;
  --lime: #b6f36b;
  --lime-hi: #c2ff78;
  --lime-ink: #10150c;
  --violet: #9d8cff;
  --violet-soft: #c0b6ff;
  --amber: #f4bc5f;
  --display: "Geist", system-ui, sans-serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pad: clamp(1.25rem, 5vw, 3rem);
  --max: 76rem;
  --mx: 50vw;
  --my: 20vh;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--body);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
code, pre { font-family: var(--mono); }
code { font-size: 0.86em; }
b { font-weight: 600; color: #fff; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--lime); color: var(--lime-ink); }

h1, h2, h3 { margin: 0; color: #fff; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.045em; line-height: 0.98; }
h2 { font-size: clamp(2rem, 5vw, 3.25rem); }
h3 { font: 600 1.05rem/1.2 var(--sans); }
p { margin: 0; }
.muted { color: var(--muted); }

/* Backdrop: dot grid, two colour washes, and a spotlight that follows the pointer */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60rem 36rem at 8% -8%, rgba(182, 243, 107, 0.13), transparent 70%),
    radial-gradient(54rem 40rem at 100% 12%, rgba(157, 140, 255, 0.16), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.07) 1px, transparent 0) 0 0 / 28px 28px;
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 1px 1px, var(--lime) 1.4px, transparent 0) 0 0 / 28px 28px;
  -webkit-mask-image: radial-gradient(18rem circle at var(--mx) var(--my), #000, transparent 70%);
  mask-image: radial-gradient(18rem circle at var(--mx) var(--my), #000, transparent 70%);
  opacity: 0.55;
}

/* Nav */
.nav {
  max-width: var(--max); margin: 0 auto; padding: 1.1rem var(--pad);
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; font: 800 1.35rem/1 var(--display); color: #fff; letter-spacing: -0.02em; }
.brand-mark { display: block; border-radius: 9px; }
.nav nav { display: flex; align-items: center; gap: 1.75rem; font: 500 0.9rem/1 var(--mono); }
.nav nav a { text-decoration: none; color: var(--muted); transition: color 0.15s; }
.nav nav a:hover { color: #fff; }
.nav .nav-gh { color: var(--lime); }
@media (max-width: 640px) { .nav nav a:not(.nav-gh) { display: none; } }
.brand span, .nav-gh { white-space: nowrap; }
@media (max-width: 30rem) { .brand { font-size: 1rem; gap: 0.55rem; } .nav-gh span { display: none; } }
@media (max-width: 23rem) { .nav-gh { display: none; } }

main { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad); }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center;
  padding-block: clamp(1.5rem, 5vw, 4.5rem) clamp(3rem, 8vw, 6rem);
}
h1 { font-size: clamp(3rem, 13.5vw, 5.25rem); line-height: 0.95; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
h1 em {
  font-style: normal; color: var(--lime); display: inline-block;
  transform: skewX(-10deg); transform-origin: 0 100%;
  text-shadow: 0 0 60px rgba(182, 243, 107, 0.35);
}

/* The download button is the page */
.dl {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; max-width: 34rem; min-height: 5.25rem; padding: 0 clamp(1rem, 4vw, 1.5rem) 0 clamp(1.1rem, 4vw, 1.6rem);
  background: var(--lime); color: var(--lime-ink); text-decoration: none; border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(182, 243, 107, 0.6), 0 18px 50px -12px rgba(182, 243, 107, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.dl::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
  transform: translateX(-120%); animation: sheen 1.2s 0.9s ease-out 1 forwards;
}
.dl:hover { background: var(--lime-hi); transform: translateY(-3px); box-shadow: 0 0 0 1px var(--lime-hi), 0 26px 64px -12px rgba(182, 243, 107, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.dl:active { transform: translateY(0); }
.dl-main { display: flex; align-items: center; gap: clamp(0.55rem, 2vw, 0.9rem); font: 800 clamp(1.4rem, 6vw, 2.15rem)/1 var(--display); letter-spacing: -0.02em; white-space: nowrap; }
.dl-arrow { flex: none; width: clamp(1.25rem, 5vw, 1.625rem); height: auto; transition: transform 0.2s; }
.dl:hover .dl-arrow { transform: translateY(3px); }
.dl-meta { font: 500 0.82rem/1.25 var(--mono); text-align: right; opacity: 0.8; white-space: nowrap; }
.dl-meta span { display: block; }
@media (max-width: 30rem) {
  .dl { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.55rem; padding-block: 1.15rem; }
  .dl-meta { text-align: left; padding-left: calc(clamp(1.25rem, 5vw, 1.625rem) + clamp(0.55rem, 2vw, 0.9rem)); }
  .dl-meta span { display: inline; }
  .dl-meta span + span::before { content: " · "; }
}
.dl-pulse { display: inline-block; width: 4rem; height: 0.7rem; border-radius: 99px; background: rgba(16, 21, 12, 0.18); animation: pulse 1s infinite alternate; }
@keyframes sheen { to { transform: translateX(120%); } }
@keyframes pulse { to { opacity: 0.3; } }

.hashes { margin: 1.25rem 0 0; display: grid; gap: 0.35rem; max-width: 34rem; font: 400 0.8rem/1 var(--mono); }
.hashes > div { display: flex; align-items: center; gap: 0.9rem; }
.hashes dt { flex: none; width: 4.5rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; }
.hashes dd { margin: 0; display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.hashes code { color: var(--muted); font-size: inherit; overflow: hidden; text-overflow: ellipsis; }

.copy {
  font: 500 0.72rem/1 var(--mono); color: var(--lime); background: none; cursor: pointer;
  border: 1px solid rgba(182, 243, 107, 0.3); border-radius: 6px; padding: 0.38rem 0.55rem; transition: background 0.15s, color 0.15s;
}
.copy:hover { background: var(--lime); color: var(--lime-ink); }

.fallback { margin-top: 1.25rem; max-width: 34rem; border: 1px solid rgba(255, 117, 109, 0.4); background: rgba(255, 117, 109, 0.07); border-radius: 12px; padding: 0.9rem 1.1rem; font-size: 0.92rem; }

/* Release card */
.board.off .flaps { opacity: 0.45; }
.board {
  position: relative; max-width: 26rem; width: 100%;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: 22px; padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.02) inset, 0 -1px 0 rgba(182, 243, 107, 0.25) inset;
}
.board::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(182, 243, 107, 0.55), transparent 35%, transparent 65%, rgba(157, 140, 255, 0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.board-head { display: flex; align-items: center; gap: 0.6rem; font: 500 0.72rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--lime); margin-bottom: 1rem; }
.board-pkg { margin-left: auto; color: var(--dim); letter-spacing: 0.04em; text-transform: none; }
.led { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: blink 2.4s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

.flaps { display: flex; gap: 0.4rem; container-type: inline-size; }
.tile {
  position: relative; display: grid; place-items: center; flex: 1 1 0; min-width: 0;
  font-family: var(--mono); font-weight: 600; color: var(--lime); line-height: 1;
  background: linear-gradient(180deg, #202733 0 50%, #171c25 50% 100%);
  border-radius: 7px; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.tile::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: #05070a; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04); }
.tile.dot { flex: 0.32 1 0; background: none; box-shadow: none; align-self: end; }
.tile.dot::after { display: none; }
.flaps.loading .tile { color: transparent; }

.flaps.big { align-items: flex-end; }
.flaps.big .tile { max-width: 6rem; aspect-ratio: 3 / 4; font-size: clamp(2rem, calc(140cqw / var(--n, 5)), 5.2rem); }
.flaps.big .tile.dot { aspect-ratio: auto; height: 3rem; font-size: 3rem; max-width: none; }

.board-rows { margin-top: 1.1rem; display: grid; }
.board-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-top: 1px dashed var(--line); }
.val { font: 500 0.95rem/1.2 var(--mono); color: #fff; }
.lbl { font: 500 0.68rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); }
.board-qr { display: none; }

@media (min-width: 62rem) {
  .hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 4rem; }
  .board { justify-self: end; }
  .hero { min-height: calc(100svh - 5rem); }
  h1 { font-size: clamp(3.5rem, 7.4vw, 6.4rem); }
  .board-qr {
    display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px dashed var(--line);
    font-size: 0.82rem; color: var(--muted);
  }
  .qr { flex: none; width: 5.6rem; height: 5.6rem; border-radius: 8px; overflow: hidden; }
  .qr svg { display: block; width: 100%; height: 100%; }
}

/* Sections */
.what, .install, .versions { padding-block: clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.lede { margin-top: 1.25rem; max-width: 40rem; font-size: clamp(1.05rem, 2.4vw, 1.3rem); line-height: 1.5; color: var(--body); }

/* Flow diagram */
.flow { margin-top: clamp(2rem, 5vw, 3.5rem); display: grid; align-items: stretch; grid-template-columns: 1fr; }
.node {
  position: relative; display: flex; flex-direction: column; gap: 0.45rem; padding: 1.25rem 1.35rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
}
.node b { font: 700 1.35rem/1.1 var(--display); letter-spacing: -0.02em; }
.node small { color: var(--muted); font-size: 0.85rem; line-height: 1.55; }
.node small code { color: var(--body); background: var(--elev); padding: 0.1rem 0.4rem; border-radius: 5px; margin-right: 0.2rem; }
.node-tag { font: 500 0.68rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); }
.node-phone { border-color: rgba(182, 243, 107, 0.45); box-shadow: 0 0 40px -18px var(--lime); }
.node-phone .node-tag { color: var(--lime); }
.node-agents { border-color: rgba(157, 140, 255, 0.5); box-shadow: 0 0 40px -18px var(--violet); }
.node-agents .node-tag { color: var(--violet); }
.node-agents small code { color: var(--violet-soft); }
.node-host { background: linear-gradient(180deg, var(--elev), var(--panel)); }

.wire { position: relative; display: grid; place-items: center; min-height: 4.5rem; --c: var(--lime); }
.wire-violet { --c: var(--violet); }
.wire::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: repeating-linear-gradient(180deg, var(--c) 0 6px, transparent 6px 14px); background-size: 100% 14px;
  animation: flow-y 0.7s linear infinite;
}
.wire span {
  position: relative; font: 500 0.7rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--c);
  background: var(--ink); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: 99px; padding: 0.45rem 0.8rem; white-space: nowrap;
}
@keyframes flow-y { to { background-position: 0 14px; } }
@keyframes flow-x { to { background-position: 14px 0; } }

@media (min-width: 52rem) {
  .flow { grid-template-columns: 1fr minmax(7rem, 0.55fr) 1fr minmax(7rem, 0.55fr) 1fr; }
  .wire { min-height: 0; }
  .wire::before {
    left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 2px; margin: -1px 0 0;
    background: repeating-linear-gradient(90deg, var(--c) 0 6px, transparent 6px 14px); background-size: 14px 100%;
    animation-name: flow-x;
  }
  .wire span { font-size: 0.64rem; padding: 0.4rem 0.6rem; }
}

.what-grid { margin-top: clamp(2rem, 5vw, 3.5rem); display: grid; gap: 2rem; align-items: start; }
@media (min-width: 52rem) { .what-grid { grid-template-columns: 1.05fr 0.95fr; gap: 3.5rem; } }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.facts li { padding-left: 1.1rem; border-left: 2px solid var(--line); color: var(--muted); }
.facts li:nth-child(1) { border-color: var(--lime); }
.facts li:nth-child(2) { border-color: var(--violet); }
.facts li:nth-child(3) { border-color: var(--amber); }

.term { margin: 0; background: #05070a; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.term figcaption { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0.9rem; background: var(--panel); border-bottom: 1px solid var(--line); font: 500 0.7rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); }
.term pre, .cmd { margin: 0; padding: 1rem 1.1rem 1.15rem; overflow-x: auto; font-size: 0.85rem; line-height: 1.75; color: #e6eaf0; }
.term code, .cmd code { font-size: inherit; }
.c { color: var(--dim); }
.p { color: var(--lime); margin-right: 0.5ch; }
.caret { display: inline-block; width: 0.6ch; height: 1.1em; margin-left: 0.4ch; vertical-align: text-bottom; background: var(--lime); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* Install */
.steps { list-style: none; counter-reset: s; margin: clamp(1.75rem, 4vw, 2.75rem) 0 0; padding: 0; display: grid; gap: 1rem; }
.steps li { counter-increment: s; position: relative; padding: 1.1rem 1.25rem 1.1rem 4rem; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; color: var(--muted); }
.steps li::before {
  content: counter(s); position: absolute; left: 1.1rem; top: 1rem; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--lime); color: var(--lime-ink); font: 700 0.95rem/1 var(--mono);
}
.steps b { display: block; margin-bottom: 0.15rem; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); } .steps li { padding: 4.2rem 1.4rem 1.4rem; } .steps li::before { left: 1.4rem; top: 1.3rem; } }

.pair { margin-top: 1rem; display: grid; gap: 1rem; }
@media (min-width: 52rem) { .pair { grid-template-columns: 1fr 1fr; } }
.card { padding: 1.4rem; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }
.card > p:not(.fine) { color: var(--muted); font-size: 0.95rem; margin-top: -0.4rem; }
.field { display: flex; align-items: center; gap: 0.6rem; background: #05070a; border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.6rem 0.55rem 0.85rem; min-width: 0; }
.field code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; color: #e6eaf0; scrollbar-width: none; }
.fine { font-size: 0.85rem; color: var(--muted); }
.fine code { background: var(--elev); padding: 0.1rem 0.4rem; border-radius: 5px; color: var(--body); }
.ghost {
  align-self: flex-start; margin-top: auto; text-decoration: none; font: 600 0.92rem/1 var(--sans); color: #fff;
  border: 1px solid var(--line); background: var(--elev); border-radius: 10px; padding: 0.85rem 1.1rem; transition: border-color 0.15s, color 0.15s;
}
.ghost:hover { border-color: var(--lime); color: var(--lime); }
.full { margin: 0; display: grid; gap: 0.3rem; }
.full dt { font: 500 0.68rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); margin-top: 0.5rem; }
.full dd { margin: 0; }
.full code { display: block; word-break: break-all; padding: 0.6rem 0.75rem; background: #05070a; border: 1px solid var(--line); border-radius: 8px; color: #e6eaf0; font-size: 0.78rem; line-height: 1.5; }
.cmd { background: #05070a; border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 0.9rem; font-size: 0.78rem; line-height: 1.7; }

/* Versions */
.list { margin-top: clamp(1.75rem, 4vw, 2.5rem); border-top: 1px solid var(--line); }
.rel { border-bottom: 1px solid var(--line); }
.rel summary {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.5rem 1.25rem; padding: 1.1rem 0; cursor: pointer; list-style: none; min-height: 3.5rem;
}
.rel summary::-webkit-details-marker { display: none; }
.rel summary::after { content: "+"; font: 500 1.4rem/1 var(--mono); color: var(--dim); grid-column: 3; grid-row: 1; transition: transform 0.2s, color 0.2s; }
.rel[open] summary::after { transform: rotate(45deg); color: var(--lime); }
.rel summary:hover .rel-v { color: var(--lime); }
.rel-v { font: 600 clamp(1.25rem, 4vw, 1.75rem)/1 var(--mono); color: #fff; transition: color 0.15s; }
.rel-tag { display: inline-block; margin-left: 0.7rem; padding: 0.25rem 0.5rem; font: 500 0.65rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--lime-ink); background: var(--lime); border-radius: 5px; vertical-align: middle; }
.rel-meta { grid-column: 2; font: 400 0.8rem/1.3 var(--mono); color: var(--muted); text-align: right; }
.rel-body { padding: 0 0 1.5rem; display: grid; gap: 1.1rem; max-width: 50rem; }
.rel-body h4 { margin: 0 0 0.4rem; font: 500 0.7rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--violet); }
.rel-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.4rem; }
.rel-body li { padding-left: 1rem; position: relative; color: var(--body); font-size: 0.95rem; }
.rel-body li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.4rem; height: 2px; background: var(--dim); }
.rel-body a { color: var(--lime); text-underline-offset: 3px; }
.rel-body a.ref { color: var(--dim); font: 400 0.78rem var(--mono); text-decoration: none; }
.rel-body a.ref:hover { color: var(--lime); }
.rel-dl { justify-self: start; display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font: 600 0.9rem/1 var(--sans); color: var(--lime); border: 1px solid rgba(182, 243, 107, 0.4); border-radius: 10px; padding: 0.8rem 1.1rem; transition: background 0.15s, color 0.15s; }
.rel-dl:hover { background: var(--lime); color: var(--lime-ink); }
.rel-dl small { font: 400 0.76rem var(--mono); opacity: 0.75; }
@media (max-width: 40rem) {
  .rel summary { grid-template-columns: 1fr auto; }
  .rel-meta { grid-column: 1; grid-row: 2; text-align: left; }
  .rel summary::after { grid-row: 1 / span 2; grid-column: 2; }
}

.foot { width: min(calc(100% - 2 * var(--pad)), calc(var(--max) - 2 * var(--pad))); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 2.5rem 3.5rem; border-top: 1px solid var(--line); font: 400 0.82rem/1 var(--mono); color: var(--dim); }
.foot-id { display: flex; align-items: center; gap: 0.6rem; }
.foot-id svg { border-radius: 5px; }
.foot nav { display: flex; gap: 1.5rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--lime); }
.noscript { max-width: var(--max); margin: 0 auto; padding: 1rem var(--pad) 3rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dl::after, .wire::before, .led, .caret, .dl-pulse { animation: none; }
  .bg::after { display: none; }
}
