/* HIGH style: Space Grotesk, cyan / red / pink on a pale liquid background (from hijinks.uno). */
:root {
  --cyan: #54E2DC;
  --red: #E70006;
  --pink: #D979FF;
  --ink: #111;
  --muted: #555;
  --paper: rgba(255, 255, 255, 0.78);
  --rule: rgba(0, 0, 0, 0.1);
  /* Project colours; pages override these on <body> or on each index card. */
  --p-bg: #17191c;
  --p-fg: #fff;
  --p-accent: #54E2DC;
  --p-on-accent: #05070c;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--ink);
  background: #e8f8f8;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; }
img { max-width: 100%; }

/* Liquid background */
.liquid-bg { position: fixed; inset: 0; overflow: hidden; z-index: -1; background: #e8f8f8; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; will-change: transform; }
.blob-1 { width: 55%; height: 55%; background: var(--cyan); top: -15%; left: -10%; animation: blob-a 18s ease-in-out infinite; }
.blob-2 { width: 50%; height: 50%; background: var(--pink); bottom: -15%; right: -10%; animation: blob-b 22s ease-in-out infinite; }
.blob-3 { width: 45%; height: 45%; background: var(--cyan); top: 30%; right: -15%; animation: blob-b 26s ease-in-out infinite reverse; }
@keyframes blob-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60%, 40%) scale(1.1); }
}
@keyframes blob-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60%, -50%) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }

/* Frame */
.site-header, main, .site-footer { max-width: 1000px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.brand img { height: 29px; width: auto; }
.admin-nav { display: flex; gap: 12px; align-items: center; font-size: 13px; }
main { padding-bottom: 48px; }
.site-footer { padding-top: 24px; padding-bottom: 24px; font-size: 12px; color: var(--muted); text-align: center; }

h1, h2 { line-height: 1.2; }
h2 { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 12px; }

/* Index */
.intro { text-align: center; }
.intro h1 { font-size: clamp(28px, 6vw, 44px); margin: 16px 0 4px; }
.intro p { margin: 0 0 24px; color: var(--muted); }
.project-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 800px; margin: 0 auto; }
.project-card {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  min-height: 120px; padding: 24px 28px; background: var(--p-bg); color: var(--p-fg);
}
.project-name { font-size: 24px; font-weight: 700; text-decoration: none; }
.project-links { display: flex; gap: 8px; flex-wrap: wrap; }
.project-links b { opacity: 0.7; margin-left: 4px; }

/* Logos: a fixed height with the width from the image, so SVGs without an intrinsic size still show. */
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { display: block; height: 48px; width: auto; max-width: min(300px, 70vw); object-fit: contain; object-position: left center; }
.band .logo img { height: 40px; }
.logo-worldr img { height: 44px; }
.band .logo-worldr img { height: 36px; }
.logo-atlas-mundi img { height: 28px; }
.logo-mind-valley img { height: 40px; }
.band .logo-mind-valley img { height: 34px; }
.logo-core-relay img { height: 56px; }
.band .logo-core-relay img { height: 46px; }
.logo-iwtptg img { height: 40px; }
.band .logo-iwtptg img { height: 34px; }
.band .logo-atlas-mundi img { height: 24px; }
.logo-cadavra img { height: 44px; filter: sepia(1) saturate(2) brightness(0.6) hue-rotate(345deg); }
.band .logo-cadavra img { height: 36px; }
.wordmark { font-family: 'EB Garamond', Georgia, serif; font-size: 28px; font-weight: 700; letter-spacing: 0.02em; line-height: 1; color: var(--p-accent); }
.band .wordmark { font-size: 24px; }

/* Tile backgrounds, after each project's card on hijinks.uno (static here: no animation). */
.tile { position: relative; isolation: isolate; }
.tile.tile-void-junker {
  background-image: url('/static/tiles/void-junker-stars.png');
  background-size: 951px auto;
  image-rendering: pixelated;
}
.tile.tile-worldr {
  background-image:
    radial-gradient(circle at 82% 50%, rgba(79, 143, 220, 0.45), transparent 60%),
    radial-gradient(circle at 10% 110%, rgba(0, 0, 0, 0.35), transparent 45%);
}
/* A still of worldr.net's two homepage planets, rendered headless from its WebGL decor with both bodies in frame. */
.tile.tile-worldr::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  right: 220px; top: 50%; width: 241px; height: 170px; transform: translateY(-50%);
  background: url('/static/tiles/worldr-planets.png') center / contain no-repeat;
}
.band.tile-worldr::after { width: 184px; height: 130px; right: 180px; }
.tile { overflow: hidden; }

/* Mind Valley: its promo video's asterisks and sunbursts, left of the buttons, cut by the tile. */
.tile.tile-mind-valley::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  right: 220px; top: 50%; width: 272px; height: 170px; transform: translateY(-50%);
  background: url('/static/tiles/mind-valley-pattern.svg') center / contain no-repeat;
}
.band.tile-mind-valley::after { width: 208px; height: 130px; right: 180px; }

/* Core Relay: Relays and their links as the game draws them (a headless render, its background clear), left of the buttons. */
.tile.tile-core-relay::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  right: 220px; top: 50%; width: 272px; height: 170px; transform: translateY(-50%);
  background: url('/static/tiles/core-relay-relays.png') center / contain no-repeat;
}
.band.tile-core-relay::after { width: 208px; height: 130px; right: 180px; }

/* I want to play this game: its Facts log as the game draws it (a headless render, its background
   clear), left of the buttons, cut by the tile, as its hijinks.uno card scrolls it. */
.tile.tile-iwtptg::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  right: 220px; top: 0; bottom: 0; width: 204px;
  background: url('/static/tiles/iwtptg-log.png') center top 14px / 204px auto no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
}
.band.tile-iwtptg::after { width: 166px; right: 180px; background-size: 166px auto; background-position: center top 12px; }
/* Narrow, the log runs under the logo and buttons: its text would fight theirs, so it steps back. */
@media (max-width: 760px) { .tile.tile-iwtptg::after { opacity: 0.3; } }

.tile.tile-atlas-mundi::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url('/static/tiles/atlas-map.svg') center / cover no-repeat;
  opacity: 0.6;
}

/* Buttons */
button, .button {
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; border: 0; border-radius: 4px;
  background: var(--p-accent); color: var(--p-on-accent); text-decoration: none; cursor: pointer; display: inline-block;
}
button:disabled { opacity: 0.5; cursor: default; }
button.small { padding: 4px 10px; font-size: 12px; }
button.link { background: none; color: inherit; padding: 0; text-decoration: underline; font-weight: 400; }
form.inline { display: inline; }

/* Project band */
.band {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding: 20px 24px; margin-bottom: 16px; background: var(--p-bg); color: var(--p-fg);
}
.band-name { font-size: 22px; font-weight: 700; text-decoration: none; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 6px 14px; border-radius: 4px; font-size: 13px; font-weight: 600; text-decoration: none; }
.tabs a[aria-current='page'] { background: var(--p-accent); color: var(--p-on-accent); }

/* Panels */
.post-list, .new-post, .post, .comments, .admin-section, .edit, .message {
  background: var(--paper); backdrop-filter: blur(6px); padding: 16px 20px; border-radius: 4px;
}
.board { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 760px) { .board { grid-template-columns: minmax(0, 1fr); } }

/* Post list */
.list-controls { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.list-controls nav { display: flex; gap: 12px; }
.list-controls a { color: var(--muted); text-decoration: none; }
.list-controls a[aria-current='page'] { color: var(--ink); font-weight: 700; text-decoration: underline; }
.posts { list-style: none; margin: 0; padding: 0; }
.post-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--rule); }
.post-summary { min-width: 0; }
.post-title { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.post-title:hover { text-decoration: underline; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); }

/* Votes */
.vote button {
  display: flex; flex-direction: column; align-items: center; min-width: 48px; padding: 6px 8px; line-height: 1.1;
  background: #fff; color: var(--ink); border: 2px solid #000;
}
.vote.voted button { background: var(--p-accent); color: var(--p-on-accent); border-color: #000; }
.vote .count { font-weight: 700; }

/* Status badges and tags */
.status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 3px; letter-spacing: 0.04em; text-transform: lowercase; background: #eee; color: #333; }
.status-planned { background: #fff2b3; }
.status-in_progress { background: var(--cyan); color: #05070c; }
.status-done { background: #2ac53a; color: #fff; }
.status-wont_do, .status-duplicate { background: #ddd; color: #666; }
.tag { font-size: 11px; padding: 1px 6px; border: 1px solid currentColor; border-radius: 3px; }
.badge { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 3px; letter-spacing: 0.08em; background: #000; color: #fff; }

/* Forms */
form label { display: block; margin: 0 0 12px; font-size: 13px; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); }
input:not([type='hidden']), textarea, select {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit; font-size: 15px; font-weight: 400;
  background: #fff; border: 2px solid #000; border-radius: 4px;
}
textarea { resize: vertical; }
.error { background: var(--red); color: #fff; padding: 8px 12px; border-radius: 4px; }
.notice { background: #fff2b3; padding: 8px 12px; border-radius: 4px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin-bottom: 12px; }

/* Post page */
.post-head { display: flex; gap: 16px; align-items: flex-start; }
.post h1 { margin: 0; font-size: clamp(22px, 4vw, 30px); overflow-wrap: anywhere; }
.post-body { margin: 16px 0; overflow-wrap: anywhere; }
.meta {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 16px 0;
  padding: 10px 14px; font-size: 13px; background: rgba(0, 0, 0, 0.05); border-radius: 4px;
}
.meta dt { font-weight: 700; }
.meta dd { margin: 0; font-family: ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }
.edit-link { font-size: 13px; }
.comments { margin-top: 16px; }
.comment { padding: 12px 0; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.comment-meta b { color: var(--ink); }
.comment-admin { border-left: 4px solid var(--pink); padding-left: 12px; }
.comment-off { opacity: 0.55; }
.comment-form { margin-top: 16px; }

/* Admin */
.admin-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 16px; padding: 12px; border: 2px dashed #000; }
.admin-controls form { display: flex; align-items: end; gap: 6px; }
.admin-controls label { margin: 0; }
.admin-controls input, .admin-controls select { width: auto; }
.admin-section { margin-bottom: 16px; }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list li { padding: 8px 0; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
.excerpt { font-size: 13px; margin: 4px 0; }
.project-form {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; align-items: end;
  padding: 12px 0; border-top: 1px solid var(--rule);
}
.project-form label { margin: 0; }
.project-form .wide { grid-column: 1 / -1; }

/* Widget demo page */
.widget-demo code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.widget-demo pre { margin: 8px 0 16px; padding: 12px; overflow-x: auto; color: #e8f8f8; background: #111; border-radius: 4px; }
.widget-project { padding-top: 12px; border-top: 1px solid var(--rule); }
