/* Catppuccin Mocha — blue / sapphire / sky accents only. */
:root {
  color-scheme: dark;
  --base: #1e1e2e;
  --mantle: #181825;
  --crust: #11111b;
  --surface0: #313244;
  --surface1: #45475a;
  --surface2: #585b70;
  --text: #cdd6f4;
  --subtext0: #a6adc8;
  --subtext1: #bac2de;
  --blue: #89b4fa;
  --sapphire: #74c7ec;
  --sky: #89dceb;
  --red: #f38ba8;

  --rule: var(--surface0);
  --accent: var(--blue);
  --accent-2: var(--sapphire);
  --accent-3: var(--sky);
}

* {
  box-sizing: border-box;
}

html,
body {
  background: var(--base);
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  line-height: 1.55;
}

main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

main.wide {
  max-width: 64rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-3);
  text-decoration: underline;
}

code,
.hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* ── Nav ─────────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 0 0.75rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.nav .brand {
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav a {
  color: var(--subtext0);
  font-size: 0.95rem;
}
.nav a:hover,
.nav a.active {
  color: var(--accent);
  text-decoration: none;
}

/* ── Typography ──────────────────────────────────────────────── */

h1 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
h2 {
  font-size: 1.25rem;
  margin: 2.5rem 0 0.75rem;
  letter-spacing: -0.01em;
  color: var(--accent);
}
h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--accent-2);
}
p,
li {
  color: var(--text);
}
.tagline {
  margin: 0.25rem 0 0;
  color: var(--subtext0);
  font-size: 1.05rem;
}
.subtle {
  color: var(--subtext0);
}

ul {
  padding-left: 1.25rem;
}
li {
  margin-bottom: 0.5rem;
}

strong {
  color: var(--accent-2);
  font-weight: 600;
}

/* ── Hero (landing) ──────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}
.hero .copy h1 {
  font-size: 2.6rem;
  margin: 0 0 0.5rem;
}
.hero .copy p {
  font-size: 1.1rem;
  color: var(--subtext0);
  margin: 0 0 1rem;
  max-width: 32rem;
}
.hero .art {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
}
.hero .art svg {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero .art {
    margin: 0 auto;
    width: 160px;
    height: 160px;
  }
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  font-size: 0.8rem;
  border: 1px solid var(--accent-2);
  color: var(--accent-2);
  border-radius: 999px;
  margin-right: 0.4rem;
}

/* ── Pillar cards (landing) ──────────────────────────────────── */

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.pillar {
  background: var(--mantle);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pillar h3 {
  margin: 0;
  color: var(--accent);
  font-size: 1rem;
}
.pillar p {
  margin: 0;
  color: var(--subtext0);
  font-size: 0.95rem;
  line-height: 1.5;
}
.pillar a.more {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--accent-3);
}

/* ── Buttons ─────────────────────────────────────────────────── */

.button {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--accent-2);
  border-radius: 6px;
  color: var(--accent-2);
  font-size: 0.92rem;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.button:hover {
  background: var(--accent-2);
  color: var(--base);
  text-decoration: none;
}
.button.primary {
  border-color: var(--accent);
  color: var(--accent);
}
.button.primary:hover {
  background: var(--accent);
  color: var(--base);
}

/* ── Footer ──────────────────────────────────────────────────── */

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--subtext0);
  font-size: 0.9rem;
}

/* ── Status text ─────────────────────────────────────────────── */

.status {
  color: var(--subtext0);
}
.status.err {
  color: var(--red);
}

/* ── Firmware / companion diagrams ───────────────────────────── */

.flashmap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--crust);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}
.flashmap .row {
  display: grid;
  grid-template-columns: 9rem 1fr 7rem;
  gap: 1rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface0);
  align-items: center;
}
.flashmap .row.free {
  background: var(--mantle);
  color: var(--accent);
}
.flashmap .row .label {
  color: var(--subtext1);
}
.flashmap .row .size {
  text-align: right;
  color: var(--subtext0);
}
.flashmap .row.free .size,
.flashmap .row.free .label {
  color: var(--accent);
}

.callout {
  background: var(--mantle);
  border-left: 3px solid var(--accent-2);
  padding: 0.85rem 1rem;
  border-radius: 0 6px 6px 0;
  margin: 1.25rem 0;
  color: var(--subtext1);
}
.callout strong {
  color: var(--accent);
}

.screenshot {
  display: block;
  max-width: 100%;
  margin: 1rem auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--mantle);
}
figure {
  margin: 1.5rem 0;
}
figure figcaption {
  color: var(--subtext0);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 0.4rem;
}

/* ── Catalog (apps.html) ─────────────────────────────────────── */

.catalog-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}
.catalog-controls input[type='search'] {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--mantle);
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}
.catalog-controls input[type='search']:focus {
  outline: none;
  border-color: var(--accent-2);
}
.category-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.category-pills button {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--surface1);
  background: transparent;
  color: var(--subtext0);
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  font: inherit;
}
.category-pills button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--mantle);
}
.category-pills button:hover {
  color: var(--accent-3);
  border-color: var(--accent-3);
}

.apps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.9rem;
}
.app {
  background: var(--mantle);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.app .top {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.app .top strong {
  color: var(--accent);
  font-size: 1rem;
}
.app .meta {
  font-size: 0.85rem;
  color: var(--subtext0);
}
.app .cat {
  font-size: 0.75rem;
  padding: 0.08rem 0.5rem;
  border: 1px solid var(--accent-2);
  color: var(--accent-2);
  border-radius: 999px;
  margin-left: auto;
  white-space: nowrap;
}
.app .desc {
  margin: 0.1rem 0 0.3rem;
  color: var(--subtext1);
  font-size: 0.92rem;
  line-height: 1.45;
}
.app .foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.app .hash {
  font-size: 0.75rem;
  color: var(--subtext0);
}
.app .size {
  font-size: 0.75rem;
  color: var(--subtext0);
}

.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--subtext0);
  border: 1px dashed var(--rule);
  border-radius: 8px;
}
