/* Palette taken from the low-poly cat logo: its navy and steel-blue fur for the neutrals, and the
   eye green as the accent. */
:root {
  --bg: #0f141b;
  --bg-2: #141b24;
  --panel: #1b2430;
  --line: #2a3646;
  --text: #e6ebf0;
  --muted: #93a3b8;
  --soft: #c4d3e6;
  --accent: #9ccb74;
  --accent-deep: #6d9359;
  --accent-hi: #c2e3a3;
  --radius: 14px;
  --mono: ui-monospace, 'JetBrains Mono', 'Fira Code', Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }
img { max-width: 100%; }

/* ------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: .08em; }
.brand-word { height: 19px; width: auto; margin-top: 2px; }
.nav-links { display: flex; gap: clamp(12px, 3vw, 28px); font-size: 15px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.home .nav {
  position: fixed; left: 0; right: 0;
  transform: translateY(-100%); opacity: 0; pointer-events: none;
  transition: transform .3s ease, opacity .3s ease, border-color .2s;
}
.home .nav.scrolled { transform: none; opacity: 1; pointer-events: auto; }

/* ------------------------------------------------------------ hero */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #1a2738 0%, var(--bg) 72%);
}
#nodes { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; text-align: center; padding: 72px 24px 56px; max-width: 760px; pointer-events: none; }
.hero-logo { width: min(clamp(180px, 34vw, 320px), 34vh); height: auto; filter: drop-shadow(0 10px 48px rgba(159, 188, 223, .24)); }
.hero h1 {
  margin: 12px 0 4px; font-size: clamp(44px, 9vw, 88px); line-height: 1; font-weight: 300; letter-spacing: .12em;
  font-family: 'Orbitron', var(--sans);
}
.hero-word { display: block; height: clamp(56px, 9vw, 92px); width: auto; margin: 0 auto; }
.hero-cta { position: absolute; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.hero-cta .btn { padding: 12px 26px; font-size: 16px; }
.scroll-hint { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); font-size: 28px; color: var(--muted); animation: bob 2s infinite; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ------------------------------------------------------------ buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; font-size: 15px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent-deep), var(--accent)); border-color: transparent; color: #10160c; font-weight: 600; }
.btn.primary:hover { color: #10160c; filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--muted); cursor: default; }
.btn.ghost:hover { transform: none; border-color: var(--line); }

/* ------------------------------------------------------------ sections */
main { display: block; }
.section { max-width: 1180px; margin: 0 auto; padding: 88px clamp(16px, 4vw, 48px) 24px; }
/* Headings kept for screen readers and outline only. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Between projects and toys: a thin line with a small low-poly diamond in the middle. */
.divider { display: flex; align-items: center; gap: 18px; max-width: 1180px; margin: 64px auto 0; padding: 0 clamp(16px, 4vw, 48px); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line) 30%, var(--line) 70%, transparent); }
.divider span { width: 14px; height: 14px; transform: rotate(45deg); background: linear-gradient(135deg, var(--accent-hi) 50%, var(--accent-deep) 50%); opacity: .8; }
.toys { padding-top: 56px; }
/* Newsletter signup: a centered closing call, the button inside the email field. */
.subscribe { max-width: 560px; padding-top: 56px; padding-bottom: 0; text-align: center; }
.subscribe h2 { margin: 0 0 14px; font-size: 18px; font-weight: 600; text-wrap: balance; }
.subscribe-lead { margin: -8px auto 14px; color: var(--muted); font-size: 15px; }
.subscribe form { display: flex; align-items: center; max-width: 400px; margin: 0 auto; padding: 4px 4px 4px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); transition: border-color .15s, box-shadow .15s; }
.subscribe form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.subscribe input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; outline: none; }
.subscribe .btn { flex: none; padding: 7px 16px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; }
.subscribe .trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.subscribe-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.subscribe-note a { color: var(--accent); }

/* ------------------------------------------------------------ project cards */
/* Flex, not grid, so every row fills the width; site.js decides how many cards go on each
   row (short rows first) from --min, the narrowest a card may get. */
.grid { --min: 320px; display: flex; flex-wrap: wrap; gap: 22px; }
.card {
  flex: 1 1 var(--min); min-width: 0;
  display: flex; flex-direction: column; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover { color: var(--text); transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 18px 50px -20px color-mix(in srgb, var(--accent) 50%, transparent); }
/* Featured: full width, cover on the left. */
.card.featured { flex-basis: 100%; flex-direction: row; }
.card.featured .cover { flex: 0 0 62%; aspect-ratio: 16 / 9; }
.card.featured .card-body { padding: 28px 30px; justify-content: center; }
.card.featured h3 { font-size: 30px; }
.card.featured p { flex: 0 1 auto; font-size: 17px; margin-bottom: 22px; }
.card.featured .card-foot { flex-direction: column; align-items: flex-start; }
/* A card alone on its row (set by site.js): side by side, like featured but smaller. */
.card.wide { flex-direction: row; }
.card.wide .cover { flex: 0 0 50%; }
.card.wide .card-body { justify-content: center; }
.card.wide p { flex: 0 1 auto; }
.toy.wide { flex-direction: row; }
.toy.wide img { flex: 0 0 40%; width: 40%; }
.toy.wide div { align-self: center; }
@media (max-width: 860px) {
  .card.featured { flex-direction: column; }
  .card.featured .cover { flex: none; }
}
.cover { position: relative; aspect-ratio: 16 / 9; background: var(--panel); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .4s; }
.card:hover .cover img { transform: scale(1.03); }
.cover-fallback { display: grid; place-items: center; height: 100%; font-size: 48px; color: var(--accent); font-family: var(--mono); }
.play { position: absolute; right: 12px; bottom: 12px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--accent); color: #10160c; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card h3 { margin: 0; font-size: 21px; }
.card p { margin: 6px 0 16px; color: var(--muted); flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-foot time { font-size: 12px; color: var(--muted); white-space: nowrap; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li { font: 12px var(--mono); padding: 2px 8px; border-radius: 6px; background: var(--panel); color: var(--soft); border: 1px solid var(--line); }
.status { font-size: 12px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid currentColor; }
.status-active { color: var(--accent-hi); }
.status-stable { color: var(--accent); }
.status-experiment { color: #e0b75a; }
.status-archived { color: var(--muted); }

/* ------------------------------------------------------------ toys */
.toy-list { --min: 240px; display: flex; flex-wrap: wrap; gap: 16px; }
.toy { flex: 1 1 var(--min); min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); color: var(--text); transition: transform .2s, border-color .2s; }
.toy:hover { color: var(--text); border-color: var(--accent); transform: translateY(-3px); }
.toy img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; }
.toy div { padding: 12px 16px 16px; }
.toy strong { font-size: 16px; }
.toy p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ------------------------------------------------------------ project page */
.project { max-width: 1080px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 48px) 40px; }
.back { font-size: 14px; color: var(--muted); }
.project-head { padding: 20px 0 28px; }
.project-title { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.project-title h1 { font-size: clamp(36px, 6vw, 58px); margin: 12px 0 4px; line-height: 1.1; }
.project-head .tagline { font-size: 20px; color: var(--soft); margin: 4px 0 14px; max-width: 760px; }
.project-head .actions { margin-top: 22px; }
.project-cover { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 20px; }

.demo { position: relative; width: min(1320px, calc(100vw - 32px)); left: 50%; transform: translateX(-50%); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #000; margin-bottom: 24px; box-shadow: 0 30px 80px -40px color-mix(in srgb, var(--accent) 60%, transparent); }
.demo-bar { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 13px; background: var(--panel); color: var(--muted); }
.demo iframe { display: block; width: 100%; height: min(78vh, 820px); border: 0; background: #fff; }

.project-body { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; }
@media (max-width: 860px) { .project-body { grid-template-columns: 1fr; } .project-body aside { order: -1; } }

/* projects with extra pages: a docs layout, sidebar | page | facts (facts on the Overview only) */
.project.docs { max-width: 1280px; }
.project-body.has-nav { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding-top: 8px; border-top: 1px solid var(--line); }
.project-body.has-nav.has-facts { grid-template-columns: 220px minmax(0, 1fr) 220px; }
.docs-nav { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding: 20px 0; font-size: 14px; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav > ul > li > a { display: block; padding: 7px 12px; border-left: 2px solid var(--line); color: var(--muted); }
.docs-nav > ul > li > a:hover { color: var(--text); }
.docs-nav li.active > a { color: var(--text); border-left-color: var(--accent); font-weight: 600; }
.docs-nav .toc { margin: 2px 0 8px; }
.docs-nav .toc a { display: block; padding: 4px 12px 4px 24px; border-left: 2px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.4; }
.docs-nav .toc a:hover, .docs-nav .toc a.current { color: var(--text); }
.docs-nav .toc code { font: .92em var(--mono); }
.project-body.has-nav .prose { padding-top: 20px; }
.project-body.has-nav aside { padding-top: 20px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a, .pager button { display: flex; flex-direction: column; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-weight: 600; }
.pager a:hover, .pager button:hover { border-color: var(--accent); }
.pager button { font: inherit; font-weight: 600; background: none; cursor: pointer; }
.pager button[hidden], .pager[hidden] { display: none; }
.pager a span { font-size: 12px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pager .next-page { margin-left: auto; text-align: right; }
@media (max-width: 1080px) {
  .project-body.has-nav.has-facts { grid-template-columns: 200px minmax(0, 1fr); }
  .project-body.has-nav.has-facts aside { grid-column: 2; grid-row: 1; }
  .project-body.has-nav.has-facts .prose { grid-column: 2; }
  .project-body.has-nav.has-facts .docs-nav { grid-row: 1 / span 2; }
}
@media (max-width: 860px) {
  .project-body.has-nav, .project-body.has-nav.has-facts { grid-template-columns: 1fr; gap: 0; }
  .project-body.has-nav.has-facts > * { grid-column: auto; grid-row: auto; }
  .docs-nav { position: static; max-height: none; padding: 16px 0 0; }
  .docs-nav > ul { display: flex; flex-wrap: wrap; gap: 6px; }
  .docs-nav > ul > li > a { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
  .docs-nav li.active > a { border-color: var(--accent); }
  .docs-nav .toc { display: none; }
}
.facts { position: sticky; top: 80px; margin: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); font-size: 14px; }
.facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.facts dd { margin: 0 0 12px; }
.facts dd:last-child { margin-bottom: 0; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 40px; }
.gallery figure { margin: 0; }
.gallery img { border-radius: 10px; border: 1px solid var(--line); display: block; }
.gallery figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

.next { display: flex; flex-direction: column; align-items: flex-end; margin-top: 64px; padding: 24px; border-top: 1px solid var(--line); color: var(--text); }
.next span { font-size: 13px; color: var(--muted); }
.next strong { font-size: 24px; }

/* ------------------------------------------------------------ prose (rendered markdown) */
.prose { min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 32px; }
.prose :is(h2, h3) { scroll-margin-top: 80px; }
.prose h2 { font-size: 24px; margin-top: 2.2em; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 19px; margin-top: 1.8em; }
.prose p, .prose li { color: #cdd6e1; }
.prose strong { color: var(--text); }
.prose code { font: .88em var(--mono); background: var(--panel); padding: 2px 6px; border-radius: 5px; color: var(--soft); }
.prose pre { background: #0b1016; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; overflow-x: auto; line-height: 1.5; }
.prose pre code { background: none; padding: 0; color: #d6dee8; font-size: 14px; }
.prose blockquote { margin: 1.2em 0; padding: 4px 18px; border-left: 3px solid var(--accent); color: var(--muted); background: var(--bg-2); border-radius: 0 8px 8px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 12px; text-align: left; }
.prose th { background: var(--panel); }
.prose thead:not(:has(th:not(:empty))) { display: none; }   /* `| | |` key/value tables */
.prose img { border-radius: 10px; border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .prose .cols { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ misc */
.notfound { min-height: 70vh; display: grid; place-content: center; text-align: center; }
.notfound h1 { font-size: 96px; margin: 0; color: var(--accent); }
.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; padding: 48px 20px; margin-top: 64px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Privacy page and the cookie banner (stats.js). The banner floats above the hero's button
   (.hero-cta: 76px from the bottom, ~52px tall), so it covers neither that nor the footer. */
.privacy { max-width: 760px; }
.consent { position: fixed; z-index: 50; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(680px, calc(100% - 24px)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0, 0, 0, .45); color: var(--soft); font-size: 14px; }
.consent p { margin: 0; flex: 1 1 280px; }
.consent a { color: var(--accent); }
.consent div { display: flex; gap: 8px; margin-left: auto; }
.consent .btn { padding: 6px 14px; font-size: 14px; cursor: pointer; }
.consent [data-c="no"] { color: var(--muted); }

/* ------------------------------------------------------------ updates (press/updates/) */
.latest { margin: -6px 0 14px; font-size: 14px; color: var(--muted); }
.update-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.update-version { font: 12px var(--mono); padding: 1px 8px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-hi); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.update-kind { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--soft); }
.update-list { list-style: none; margin: 0; padding: 0; }
.update-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.update-item:first-child { padding-top: 4px; }
.update-title { font-weight: 600; font-size: 16px; color: var(--text); }
.update-title:hover { color: var(--accent-hi); }
.update-project { color: var(--accent); font-weight: 600; }
.update-project:hover { color: var(--accent-hi); }
.update-item p:last-child { margin: 4px 0 0; color: var(--soft); font-size: 15px; }
.updates-recent { margin-top: 48px; padding-top: 8px; border-top: 1px solid var(--line); }
.more { display: inline-block; margin-top: 14px; font-size: 14px; }
.updates-lead { color: var(--muted); }
.update-entry { padding: 28px 0 8px; border-top: 1px solid var(--line); }
.update-entry h2 { margin-top: 0; }
.update-entry h2 a { color: var(--text); }
.update-entry h2 a:hover { color: var(--accent-hi); }
.card-head h3 { flex: 1; }
.card-version { font: 12px var(--mono); padding: 1px 8px; border-radius: 6px; white-space: nowrap; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-hi); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.news-projects { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; }
.news-projects button { font: inherit; font-size: 13px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--soft); background: none; cursor: pointer; }
.news-projects button:hover { border-color: var(--accent); color: var(--accent-hi); }
.news-projects button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--bg); font-weight: 600; }
.news-list .update-item[hidden] { display: none; }
/* an update's own sections (New, Fixed...) sit under its title, not beside it */
.update-body h2 { font-size: 17px; margin: 24px 0 6px; padding: 0; border: 0; color: var(--soft); }
.update-body h3 { font-size: 15px; margin: 18px 0 4px; }
.update-body ul { margin-top: 4px; }
.update-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.update-links a { font-size: 13px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--soft); }
.update-links a:hover { border-color: var(--accent); color: var(--accent-hi); }
