/* SPDX-License-Identifier: MIT */
:root {
  --bg: #f3f7fc; --panel: #ffffff; --ink: #18202b; --dim: #5a6574; --line: #dce5f0;
  --blue: #2f74e0; --blue-ink: #1d5bbf; --blue-soft: #e3eefc; --orange: #ff7800; --green: #1fa96a;
  --bubble: rgb(120 170 235 / 22%); --shadow: 0 2px 14px rgb(30 60 110 / 8%);
  --head: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161d; --panel: #1a212b; --ink: #e8edf3; --dim: #a1acba; --line: #2b3542;
    --blue: #5b9bff; --blue-ink: #8ab8ff; --blue-soft: #1d2b40; --bubble: rgb(91 155 255 / 12%);
    --shadow: 0 2px 14px rgb(0 0 0 / 35%); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue-ink); text-underline-offset: 2px; }
code { white-space: nowrap; font: 0.88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--blue-soft); padding: 0.1em 0.35em; border-radius: 5px; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; }
h2 { font-size: 2.1rem; font-weight: 800; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.35rem; }
img { max-width: 100%; height: auto; }

/* the bar at the top */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem max(1rem, calc((100% - 68rem) / 2)); background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font: 800 1.25rem var(--head); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.brand .dot { width: 0.85rem; height: 0.85rem; border-radius: 50%; background: var(--blue); box-shadow: 0.55rem -0.35rem 0 -0.15rem var(--orange); }
.brand .plus { color: var(--dim); font-weight: 600; }
.top nav { display: flex; gap: 1.1rem; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { color: var(--dim); text-decoration: none; font: 600 0.98rem var(--head); }
.top nav a:hover { color: var(--blue-ink); }
@media (max-width: 40rem) { .top nav { display: none; } }

/* the hero, over rising bubbles as the launcher has them */
.hero { position: relative; overflow: hidden; padding: 3.5rem 1rem 3rem;
  background: linear-gradient(180deg, var(--blue-soft), var(--bg)); }
.hero-in { position: relative; max-width: 68rem; margin: 0 auto; display: grid; grid-template-columns: 1.05fr 1fr; gap: 2rem; align-items: center; }
@media (max-width: 52rem) { .hero-in { grid-template-columns: 1fr; } .hero { padding-top: 2rem; } }
.kicker { margin: 0 0 0.5rem; color: var(--orange); font: 700 1rem var(--head); text-transform: uppercase; letter-spacing: 0.08em; }
.hero h1 { margin: 0 0 1rem; font-size: clamp(2.4rem, 6vw, 3.9rem); font-weight: 800; letter-spacing: -0.02em; }
.lede { font-size: 1.18rem; margin: 0 0 1.5rem; max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem; }
.small { color: var(--dim); font-size: 0.92rem; margin: 0; }
.hero-art { margin: 0; }
.hero-art img { display: block; width: 100%; border-radius: 1.5rem; box-shadow: var(--shadow); }
.bubbles i { position: absolute; bottom: -6rem; border-radius: 50%; background: var(--bubble); border: 2px solid var(--bubble);
  animation: rise 16s linear infinite; }
.bubbles i:nth-child(1) { left: 4%; width: 3rem; height: 3rem; animation-duration: 18s; }
.bubbles i:nth-child(2) { left: 14%; width: 1.4rem; height: 1.4rem; animation-duration: 12s; animation-delay: -5s; }
.bubbles i:nth-child(3) { left: 27%; width: 2.2rem; height: 2.2rem; animation-duration: 20s; animation-delay: -11s; }
.bubbles i:nth-child(4) { left: 41%; width: 1rem; height: 1rem; animation-duration: 14s; animation-delay: -2s; }
.bubbles i:nth-child(5) { left: 55%; width: 2.8rem; height: 2.8rem; animation-duration: 22s; animation-delay: -8s; }
.bubbles i:nth-child(6) { left: 68%; width: 1.6rem; height: 1.6rem; animation-duration: 15s; animation-delay: -13s; }
.bubbles i:nth-child(7) { left: 82%; width: 3.4rem; height: 3.4rem; animation-duration: 24s; animation-delay: -4s; }
.bubbles i:nth-child(8) { left: 93%; width: 1.2rem; height: 1.2rem; animation-duration: 13s; animation-delay: -9s; }
@keyframes rise { to { transform: translateY(-48rem) translateX(1.5rem); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bubbles i { animation: none; display: none; } html { scroll-behavior: auto; } }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.8rem 1.35rem; border-radius: 0.9rem; border: 2px solid var(--line);
  background: var(--panel); color: var(--ink); font: 700 1.05rem var(--head); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.btn:hover { border-color: var(--blue); transform: translateY(-1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 22px rgb(47 116 224 / 30%); }
.btn.primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
.btn svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary:hover { color: #0d1622; } }

/* sections */
main { max-width: 68rem; margin: 0 auto; padding: 0 1rem; }
main > section { margin: 3.5rem 0; scroll-margin-top: 4.5rem; }
.sub { color: var(--dim); font-size: 1.1rem; margin: 0 0 1.5rem; max-width: 46rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 1.5rem; padding: 2rem; box-shadow: var(--shadow); }
@media (max-width: 40rem) { .panel { padding: 1.25rem; } }
.num { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--blue); color: #fff;
  font: 800 1.1rem var(--head); margin-bottom: 0.6rem; }

.how h2 { margin-bottom: 1.25rem; }
.steps3 { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 52rem) { .steps3 { grid-template-columns: 1fr; } }
.steps3 li { background: var(--panel); border: 1px solid var(--line); border-radius: 1.25rem; padding: 1.25rem 1.35rem; box-shadow: var(--shadow); }
.steps3 p { margin: 0; color: var(--dim); }
.callout { display: flex; gap: 1rem; align-items: flex-start; background: color-mix(in srgb, var(--green) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line)); border-radius: 1.25rem; padding: 1.1rem 1.35rem; }
.callout svg { flex: none; width: 2rem; height: 2rem; fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 0.15rem; }
.callout p { margin: 0; }

/* the apps */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.app { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 1.25rem;
  overflow: hidden; box-shadow: var(--shadow); }
.app .shot { display: grid; place-items: center; padding: 1.1rem; background: var(--blue-soft); }
.app img { display: block; width: 100%; max-width: 240px; border-radius: 0.6rem; box-shadow: 0 4px 16px rgb(20 40 80 / 18%); }
.app picture { display: block; width: 100%; max-width: 240px; }
/* the animations are the screen's own 240 x 240 pixels: enlarged, they stay sharp */
.app img.anim { image-rendering: pixelated; }
.app > div:last-child { padding: 0.9rem 1.15rem 1.1rem; }
.app p { margin: 0; color: var(--dim); font-size: 0.97rem; }
.app h3 { margin-bottom: 0.2rem; }

/* firmware that uses the card */
.fw { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 52rem) { .fw { grid-template-columns: 1fr; } }
.fw .note { margin: 0; }

/* set up a card */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 52rem) { .two { grid-template-columns: 1fr; gap: 0.5rem; } }
.need, .do { padding-left: 1.3rem; margin: 0.25rem 0 0.5rem; }
.need li, .do li { margin: 0.45rem 0; }
.need li::marker { color: var(--blue); }
.do li::marker { color: var(--blue); font-weight: 700; }

/* make an m-card */
.board-photo { max-width: 40rem; margin: 0 auto 1.5rem; text-align: center; }
.board-photo img { display: block; width: 100%; height: auto; border-radius: 1.25rem; box-shadow: var(--shadow); }
.board-photo figcaption { color: var(--dim); font: 600 0.9rem var(--head); margin-top: 0.6rem; }
.choose { margin: 0 0 1.5rem; text-align: center; }
.choose > h3 { font-size: 1.5rem; margin-bottom: 0.9rem; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 46rem; margin: 0 auto; }
@media (max-width: 40rem) { .choices { grid-template-columns: 1fr; } }
.choice { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 1.3rem 1.2rem; text-decoration: none; color: var(--ink);
  background: var(--panel); border: 2px solid var(--line); border-radius: 1.25rem; box-shadow: var(--shadow); transition: border-color 0.15s, transform 0.15s; }
.choice:hover { border-color: var(--blue); transform: translateY(-1px); }
.choice[aria-current="true"] { border-color: var(--blue); background: var(--blue-soft); }
.choice svg { width: 2.4rem; height: 2.4rem; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.choice b { font: 700 1.2rem var(--head); }
.choice span { color: var(--dim); font-size: 0.95rem; }
/* the paths' steps share one grid; with the script, only the chosen path (and then "Fit it") shows */
.path { display: contents; }
.path-title { grid-column: 1 / -1; font-size: 1.5rem; margin: 0.75rem 0 0; }
#build.asking .path-title { display: none; }
#build.asking .path, #build.asking .fit, #build.asking .path-end { display: none; }
#build[data-path="assembled"] #assembled, #build[data-path="diy"] #diy { display: contents; }
#build[data-path] .fit, #build[data-path] .path-end { display: block; }
.bstep { scroll-margin-top: 5rem; }
.bstep.wide { grid-column: 1 / -1; }
/* "Fit it" comes after either path, so its number depends on the choice; without one it has none */
.fit .num { display: none; }
#build[data-path="assembled"] .fit .num, #build[data-path="diy"] .fit .num { display: inline-grid; }
#build[data-path="assembled"] .fit .num::before { content: "3"; }
#build[data-path="diy"] .fit .num::before { content: "4"; }
.build-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 52rem) { .build-steps { grid-template-columns: 1fr; } }
.bstep { background: var(--panel); border: 1px solid var(--line); border-radius: 1.25rem; padding: 1.35rem 1.5rem; box-shadow: var(--shadow); min-width: 0; }
.bstep > p { margin: 0 0 0.6rem; }
.note { color: var(--dim); font-size: 0.93rem; }
.dl { font-weight: 600; }
.scroll { overflow-x: auto; margin: 0.25rem 0 0.6rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.4rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.settings { margin: 0.5rem 0 0.25rem; }
.settings th { white-space: nowrap; font-weight: 600; width: 1%; }
.parts thead th { color: var(--dim); font: 600 0.85rem var(--head); text-transform: uppercase; letter-spacing: 0.05em; }
.parts td:last-child { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
.parts td:first-child { text-align: center; }
.more-link { color: var(--dim); margin-top: 1.25rem; }
.watch { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.watch svg { width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.video { margin: 1.5rem auto 0; max-width: 52rem; scroll-margin-top: 4.5rem; }
.video .frame { position: relative; aspect-ratio: 16 / 9; border-radius: 1.25rem; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { text-align: center; color: var(--dim); font-size: 0.93rem; margin-top: 0.6rem; }

/* make your own */
.own { display: flex; flex-direction: column; }
.own-art { order: -1; width: 100%; max-width: 44rem; margin: 0 auto 1.25rem !important; }
.own-text > p { margin: 0 0 0.9rem; }
.own-text .small { display: block; margin-top: 0.75rem; }
.own-art { margin: 0; }
.own-art img { display: block; width: 100%; border-radius: 1.25rem; }
pre { margin: 0 0 1.1rem; padding: 1rem 1.1rem; overflow-x: auto; background: #0f1722; color: #dbe6f3; border-radius: 1rem; font-size: 0.86rem; line-height: 1.5; }
pre code { white-space: pre; background: none; padding: 0; font-size: inherit; color: inherit; }

.support { text-align: center; }
.support p { max-width: 42rem; margin: 0 auto 1.1rem; color: var(--dim); }
.support .actions { justify-content: center; }
.support .btn svg { stroke: var(--orange); }

footer { max-width: 68rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; color: var(--dim); font-size: 0.92rem; text-align: center; border-top: 1px solid var(--line); }
footer p { margin: 0.3rem 0; }
