/* beezy.ninja: one stylesheet for every page. */

@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-var.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --substrate: #eef1ea;      /* page */
  --spawn: #f8faf6;          /* raised surfaces */
  --ink: #1c2620;            /* soil */
  --ink-soft: #4d5a51;
  --lichen: #c9d2c7;         /* rules, borders */
  --golden: #d99a1e;         /* golden oyster: primary actions */
  --golden-ink: #2a1d02;
  --blue: #3f5f7f;           /* blue oyster: links */
  --uv: #6a3fa0;             /* UV-C warnings only */
  --uv-wash: #efe8f7;
  --ok: #2f6b45;
  --bad: #a3342b;
  --radius-s: 6px;
  --radius-l: 18px;
  --measure: 66ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --substrate: #161d18; --spawn: #1e2720; --ink: #e5eae2; --ink-soft: #a9b4aa;
    --lichen: #34413a; --golden: #e8ad3a; --golden-ink: #221600; --blue: #8fb3d6;
    --uv: #b994ea; --uv-wash: #2a2238; --ok: #79c495; --bad: #f08a80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --substrate: #161d18; --spawn: #1e2720; --ink: #e5eae2; --ink-soft: #a9b4aa;
  --lichen: #34413a; --golden: #e8ad3a; --golden-ink: #221600; --blue: #8fb3d6;
  --uv: #b994ea; --uv-wash: #2a2238; --ok: #79c495; --bad: #f08a80;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--substrate);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Atkinson", system-ui, sans-serif;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--golden); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: "Bricolage", system-ui, sans-serif; line-height: 1.08; margin: 0 0 0.5em; font-variation-settings: "opsz" 72; }
h1 { font-size: clamp(2.6rem, 7vw, 4.75rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: 1.3rem; font-weight: 700; font-variation-settings: "opsz" 24; }
p, ul, ol { margin: 0 0 1em; max-width: var(--measure); }
li + li { margin-top: 0.35em; }
small, .fine { font-size: 0.9rem; color: var(--ink-soft); }
code { font: 0.92em ui-monospace, "SF Mono", Menlo, monospace; background: var(--spawn); border: 1px solid var(--lichen); border-radius: 4px; padding: 0.05em 0.35em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* --- header / footer --- */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.brand { font: 800 1.25rem/1 "Bricolage", sans-serif; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand svg { width: 28px; height: 28px; }
.site-nav { display: flex; gap: 6px 20px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 700; }
.site-nav a[aria-current="page"], .site-nav a:hover { text-decoration: underline; text-decoration-color: var(--golden); text-decoration-thickness: 3px; }
.site-foot { border-top: 1px solid var(--lichen); margin-top: 96px; padding-block: 28px 48px; color: var(--ink-soft); font-size: 0.95rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
.site-foot a { color: inherit; }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent;
  font: 700 1rem/1 "Atkinson", sans-serif; text-decoration: none; cursor: pointer;
  background: var(--golden); color: var(--golden-ink);
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 0.95rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* --- hero with gills --- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 32px; padding-block: 40px 72px; }
.hero p.lede { font-size: 1.25rem; color: var(--ink-soft); max-width: 34ch; }
.gills { width: 100%; aspect-ratio: 1; color: var(--ink); }
.gills .gill { stroke: currentColor; stroke-width: 1.1; opacity: 0.55; fill: none; stroke-linecap: round; }
.gills .gill.long { opacity: 0.85; }
.gills .stipe { fill: var(--golden); }
.gills .rim { fill: none; stroke: currentColor; stroke-width: 2.5; }
@media (prefers-reduced-motion: no-preference) {
  .gills .gill { stroke-dasharray: 1; stroke-dashoffset: 1; animation: grow 1.6s cubic-bezier(.2,.7,.2,1) forwards; }
  @keyframes grow { to { stroke-dashoffset: 0; } }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-block: 16px 48px; }
  .gills { max-width: 320px; margin-inline: auto; order: -1; }
}

/* --- sections --- */
.section { padding-block: 56px 0; }
.section > h2 { max-width: 22ch; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 28px 40px; }

/* Projects: a list, not a card grid. The featured one gets the room. */
.projects { list-style: none; padding: 0; margin: 0; max-width: none; border-top: 2px solid var(--ink); }
.projects li { margin: 0; display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) auto; gap: 8px 28px; align-items: baseline; padding-block: 22px; border-bottom: 1px solid var(--lichen); }
.projects h3 { margin: 0; }
.projects p { margin: 0; }
.projects .state { font-size: 0.9rem; color: var(--ink-soft); white-space: nowrap; }
.projects .featured { padding-block: 32px; }
.projects .featured h3 { font-size: 1.75rem; }
@media (max-width: 760px) { .projects li { grid-template-columns: 1fr; } }

/* Comparison table on the project page. */
.compare { width: 100%; border-collapse: collapse; margin-block: 8px 24px; font-size: 1rem; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--lichen); }
.compare thead th { font-family: "Bricolage", sans-serif; border-bottom: 2px solid var(--ink); }
.compare td:first-child { font-weight: 700; width: 24%; }
@media (max-width: 640px) {
  .compare thead { display: none; }
  .compare tr { display: block; padding-block: 10px; border-bottom: 1px solid var(--lichen); }
  .compare td { display: block; border: 0; padding: 2px 0; width: auto !important; }
  .compare td:nth-child(2)::before { content: "Stock: "; color: var(--ink-soft); }
  .compare td:nth-child(3)::before { content: "Terra Firmware: "; color: var(--ink-soft); }
}

/* Steps really are a sequence, so they get numbers. */
.steps { counter-reset: step; list-style: none; padding: 0; max-width: 70ch; }
.steps > li { counter-increment: step; position: relative; padding-left: 52px; margin-block: 0 22px; }
.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: 800 1.05rem/1 "Bricolage", sans-serif; border: 2px solid var(--ink);
}

/* --- callouts --- */
.uv {
  border-left: 6px solid var(--uv); background: var(--uv-wash); color: var(--ink);
  padding: 16px 20px; border-radius: 0 var(--radius-s) var(--radius-s) 0; max-width: 72ch; margin-block: 20px;
}
.uv strong { color: var(--uv); }
.note { border-left: 4px solid var(--lichen); padding: 4px 0 4px 18px; color: var(--ink-soft); max-width: 70ch; }

/* --- panels (sign-in, downloads, flasher) --- */
.panel { background: var(--spawn); border: 1px solid var(--lichen); border-radius: var(--radius-l); padding: clamp(20px, 4vw, 36px); }
.panel + .panel { margin-top: 24px; }
.narrow { max-width: 560px; }
label.field { display: block; font-weight: 700; margin-bottom: 14px; }
label.field span { display: block; margin-bottom: 6px; }
input[type="email"], input[type="text"], select {
  width: 100%; min-height: 50px; padding: 0 14px; font: 400 1.1rem "Atkinson", sans-serif; color: var(--ink);
  background: var(--substrate); border: 2px solid var(--lichen); border-radius: var(--radius-s);
}
input[inputmode="numeric"] { letter-spacing: 0.3em; font-size: 1.4rem; }
input:focus { border-color: var(--golden); outline: none; }
.check { display: flex; gap: 12px; align-items: flex-start; margin-block: 10px; max-width: 70ch; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--golden); }
.status { min-height: 1.6em; margin-top: 12px; font-weight: 700; }
.status.err { color: var(--bad); }
.status.ok { color: var(--ok); }
[hidden] { display: none !important; }

.files { list-style: none; padding: 0; margin: 0; max-width: none; }
.files li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; align-items: center; padding-block: 16px; border-bottom: 1px solid var(--lichen); margin: 0; }
.files li:first-child { padding-top: 0; }
.files .meta { color: var(--ink-soft); font-size: 0.92rem; overflow-wrap: anywhere; }
@media (max-width: 560px) { .files li { grid-template-columns: 1fr; } }

/* Flasher */
.stage { border-top: 1px solid var(--lichen); padding-top: 24px; margin-top: 24px; }
.stage[aria-disabled="true"] { opacity: 0.5; }
.stage h3 .tick { color: var(--ok); }
progress { width: 100%; height: 14px; accent-color: var(--golden); margin-top: 10px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 18px; margin: 12px 0; font-size: 0.98rem; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.log { font: 0.82rem/1.45 ui-monospace, Menlo, monospace; background: var(--substrate); border: 1px solid var(--lichen); border-radius: var(--radius-s); padding: 12px; height: 200px; overflow: auto; white-space: pre-wrap; margin-top: 16px; }

/* Donate strip: plain, at the end of the page. */
.donate { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; border-block: 2px solid var(--ink); padding-block: 28px; margin-top: 72px; }
.donate p { margin: 0; font-size: 1.15rem; }

@media print { .site-nav, .donate, .gills { display: none; } }

/* Stagger the gill draw-in without inline styles (the CSP forbids them). */
@media (prefers-reduced-motion: no-preference) {
  .gills .gill:nth-of-type(8n+2) { animation-delay: 60ms; }
  .gills .gill:nth-of-type(8n+3) { animation-delay: 120ms; }
  .gills .gill:nth-of-type(8n+4) { animation-delay: 180ms; }
  .gills .gill:nth-of-type(8n+5) { animation-delay: 240ms; }
  .gills .gill:nth-of-type(8n+6) { animation-delay: 300ms; }
  .gills .gill:nth-of-type(8n+7) { animation-delay: 360ms; }
  .gills .gill:nth-of-type(8n)   { animation-delay: 420ms; }
}

@media (max-width: 560px) {
  .site-head { flex-wrap: wrap; padding-block: 16px 8px; }
  .site-nav { width: 100%; justify-content: flex-start; gap: 4px 22px; }
}
