/* botling's site. The page sits on the same square dot grid the robots are drawn on: indigo
   ink for what you can press, seafoam for what is glowing. Pixelify Sans for display only,
   the system sans for reading, the system monospace for code. */
@font-face {
  font-family: "Pixelify";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/pixelify.woff2") format("woff2-variations");
}

:root {
  color-scheme: light;
  --paper: #f3f2f8;
  --paper-sunk: #e7e5f0;
  --card: #fbfbfd;
  --ink: #17151f;
  --ink-2: #4c4a5c;
  --rule: #d4d1e1;
  --control-edge: #7d7a93; /* outlines of things you can press: 3:1 on paper and card */
  --dot: #cdc9dc;
  --accent: #3a26c9;
  --accent-ink: #ffffff;
  --accent-soft: rgb(58 38 201 / 0.1);
  --glow: #127a68;
  --display: "Pixelify", ui-sans-serif, system-ui, sans-serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --cell: 22px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14121c;
  --paper-sunk: #1c1a28;
  --card: #1b1926;
  --ink: #ece9f6;
  --ink-2: #aaa6bd;
  --rule: #302c42;
  --control-edge: #6f6a88;
  --dot: #2a2738;
  --accent: #a99cff;
  --accent-ink: #14121c;
  --accent-soft: rgb(169 156 255 / 0.14);
  --glow: #7ee8d0;
}

* {
  box-sizing: border-box;
}
button,
.choices label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
html {
  background: var(--paper);
  /* Keeps focused and scrolled-to things clear of the sticky header. */
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  color: var(--ink);
  font: 400 1.0625rem / 1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--dot) 1.2px, transparent 1.6px);
  background-size: var(--cell) var(--cell);
}
::selection {
  background: var(--accent-soft);
}
a {
  color: inherit;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover {
  text-decoration-color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus {
  left: 16px;
  background: var(--card);
  padding: 6px 10px;
  z-index: 3;
}
.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}
code,
pre {
  font-family: var(--mono);
  font-size: 0.86em;
}
:not(pre) > code {
  background: var(--paper-sunk);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.1;
  text-wrap: balance;
  letter-spacing: 0.01em;
}
p,
li {
  text-wrap: pretty;
}

/* ---- header ---- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.top .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 1.45rem / 1 var(--display);
  text-decoration: none;
}
.mark-bot svg {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.top nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  font-size: 0.95rem;
}
.top nav a {
  text-decoration: none;
  color: var(--ink-2);
}
.top nav a:hover {
  color: var(--ink);
}
.theme {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--control-edge);
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
}
.theme svg {
  width: 18px;
  height: 18px;
}
:root[data-theme="dark"] .theme .moon,
:root:not([data-theme="dark"]) .theme .sun {
  display: none;
}

/* ---- buttons and inputs ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 0.95rem / 1 var(--sans);
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--control-edge);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--accent);
}
.btn:active {
  transform: translateY(1px);
}
input[type="text"] {
  font: 500 1.05rem / 1.2 var(--mono);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--control-edge);
  border-radius: 10px;
  padding: 11px 14px;
  width: 100%;
  min-width: 0;
}
input[type="text"]:focus-visible {
  outline-offset: 1px;
}

/* ---- hero ---- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
  padding: 56px 0 32px;
}
.hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  margin: 0 0 16px;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink-2);
  max-width: 34em;
  margin: 0 0 28px;
}
.seed label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.seed-row {
  display: flex;
  gap: 10px;
  max-width: 520px;
}
.stage {
  display: grid;
  justify-items: center;
  gap: 14px;
}
.big svg {
  display: block;
  width: min(240px, 60vw);
  height: auto;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgb(23 21 31 / 0.18);
}
.sizes {
  list-style: none;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0;
  margin: 0;
}
.sizes li {
  display: grid;
  justify-items: center;
  gap: 4px;
  font: 0.75rem / 1 var(--mono);
  color: var(--ink-2);
}
.sizes svg {
  display: block;
  border-radius: 50%;
}
.note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-2);
  max-width: 22em;
  text-align: center;
}

/* ---- controls ---- */
.controls {
  display: grid;
  gap: 18px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
legend {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  padding: 0;
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choices input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.choices label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--control-edge);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
  background: var(--paper);
}
.choices input:checked + label {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.choices input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sw {
  display: inline-grid;
  grid-template-columns: repeat(4, 7px);
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.15);
}
.sw b {
  display: block;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--glow);
  font-weight: 600;
}
.code {
  margin: 0;
  padding: 14px 16px;
  background: var(--paper-sunk);
  border-radius: 10px;
  /* Wrap rather than scroll: a scrolling region would need to be focusable. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- gallery ---- */
.crowd {
  padding: 56px 0 8px;
}
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.head h2,
.use h2 {
  font-size: 2rem;
  margin: 0;
}
.gallery {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 12px;
  padding: 0;
  margin: 20px 0 0;
}
.gallery button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 16px;
}
.gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--rule);
  transition: transform 0.12s;
}
.gallery button:hover img {
  transform: translateY(-2px);
}

/* ---- use ---- */
.use {
  padding: 56px 0;
}
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  margin-top: 12px;
}
.use h3 {
  font-size: 1.2rem;
  margin: 20px 0 10px;
}
.facts {
  padding-left: 1.1em;
}
.facts li {
  margin-bottom: 10px;
}

/* ---- footer ---- */
footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding: 28px 0 40px;
  font-size: 0.95rem;
  color: var(--ink-2);
}
footer p {
  margin: 0 0 8px;
}
.fine {
  font-size: 0.85rem;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: 32px;
  }
  .cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gallery img {
    transition: none;
  }
}
