/* Brainchild — shared styles */
:root {
  --bg: #15171B;
  --panel: #14161B;
  --panel-deep: #0F1114;
  --line: #262A31;
  --line-strong: #3A3E47;
  --text: #ECEDEE;
  --text-2: #C9CCD1;
  --muted: #A3A7AE;
  --faint: #8B9099;
  --accent: #F5B83D;
  --accent-hover: #FFD27A;
  --on-accent: #15130D;
  --s-adopt: #F5B83D;
  --s-help: #7CB7FF;
  --s-test: #C9A2FF;
  --s-active: #6FD39A;
  --s-archived: #9AA0A8;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Space Grotesk", Inter, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 10px;
  --wrap: 1240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  background:
    url(../img/pattern-chip.png) repeat,
    var(--bg) url(../img/brushed-metal.png) repeat;
  background-size: 280px 280px, 512px 512px;
  min-height: 100vh;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
@media (max-width: 600px) { .wrap { padding: 0 18px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid #23262D; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 22px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px 22px; flex-grow: 1; font-size: 15px; }
.nav-links a { color: var(--text-2); text-decoration: none; padding: 6px 0; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); font-weight: 600; }
.nav-actions { display: flex; gap: 12px; align-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; border-radius: 6px; padding: 11px 18px; cursor: pointer; border: 1px solid transparent; min-height: 44px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); font-weight: 500; }
.btn-ghost:hover { border-color: var(--text-2); color: var(--text); }
.btn-light { background: var(--text); color: #0E0F12; }
.btn-light:hover { background: #fff; color: #0E0F12; }
.btn-plain { background: transparent; border: 0; color: var(--text); font-weight: 500; }
.btn-plain:hover { color: var(--accent-hover); }
.btn-lg { padding: 15px 24px; font-size: 16px; }
.btn-block { width: 100%; }

.eyebrow { margin: 0 0 14px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.tag { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); border: 1px solid #343842; padding: 2px 8px; border-radius: 4px; }
.badge { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; white-space: nowrap; color: #0E0F12; background: var(--s-archived); }
.badge[data-status="adopt"] { background: var(--s-adopt); }
.badge[data-status="help"] { background: var(--s-help); }
.badge[data-status="test"] { background: var(--s-test); }
.badge[data-status="active"] { background: var(--s-active); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--s-archived); }
.dot[data-status="adopt"] { background: var(--s-adopt); }
.dot[data-status="help"] { background: var(--s-help); }
.dot[data-status="test"] { background: var(--s-test); }
.dot[data-status="active"] { background: var(--s-active); }

.panel { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); }

/* ---------- Pills ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font: inherit; font-size: 14px; background: transparent; color: var(--text); border: 1px solid var(--line-strong); padding: 8px 16px; border-radius: 999px; cursor: pointer; min-height: 38px; }
.pill:hover { border-color: var(--text-2); }
.pill[aria-pressed="true"] { background: var(--text); color: #0E0F12; border-color: var(--text); }

/* ---------- Hero ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; padding-top: 88px; padding-bottom: 72px; }
.hero-copy { flex: 999 1 520px; min-width: 0; }
.hero h1 { margin: 0; font-weight: 700; font-size: clamp(44px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.03em; }
.hero-lede { margin: 24px 0 0; font-size: 19px; color: #B8BCC3; max-width: 560px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.continue-card { flex: 1 1 380px; min-width: 0; border: 1px solid #2C3038; background: var(--panel); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.continue-top { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-mono); font-weight: 700; font-size: 30px; letter-spacing: 0.06em; }
.continue-top span:first-child { color: var(--accent); }
.shot { background: #1D2027; border-radius: 6px; display: flex; align-items: flex-end; padding: 12px; font-family: var(--font-mono); font-size: 11px; color: #0E0F12; }
.shot span { background: rgba(236, 237, 238, 0.85); padding: 3px 8px; border-radius: 4px; }
.continue-card .shot { height: 160px; justify-content: center; align-items: center; color: var(--faint); }
.continue-card .shot span { background: none; color: var(--faint); }
.checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); }
.checks li { display: flex; gap: 10px; }
.checks li::before { content: "✓"; color: var(--s-active); font-family: var(--font-mono); }
.checks li.pending::before { content: "–"; color: var(--faint); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- Status strip ---------- */
.status-strip { border-top: 1px solid #2C3038; border-bottom: 1px solid #2C3038; background: rgba(10, 11, 14, 0.55); }
.status-strip .wrap { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: center; padding-top: 24px; padding-bottom: 24px; font-size: 15px; }
.status-strip .label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.status-item { display: flex; align-items: center; gap: 10px; }

/* ---------- Sections ---------- */
.section { padding-top: 88px; padding-bottom: 40px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 32px; }
.section-head h2 { margin: 0; font-size: 40px; letter-spacing: -0.02em; }
.section-head p { margin: 8px 0 0; color: var(--muted); }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card-grid.compact { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card .shot { height: 160px; justify-content: space-between; }
.card-grid.compact .card .shot { height: 130px; }
.kind { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); background: rgba(14, 15, 18, 0.8); padding: 3px 8px; border-radius: 4px; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.card-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card h3 { margin: 0; font-size: 20px; line-height: 1.25; }
.card .meta { margin: 0; color: var(--muted); font-size: 14px; }
.card .note { margin: 0; color: var(--text-2); font-size: 15px; flex-grow: 1; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.card-actions.single { grid-template-columns: 1fr; }
.card-actions .btn { padding: 9px; font-size: 15px; min-height: 42px; }

/* ---------- Handoff packet ---------- */
.packet { display: flex; flex-wrap: wrap; gap: 56px; padding-top: 72px; padding-bottom: 72px; }
.packet-intro { flex: 1 1 360px; min-width: 0; }
.packet-intro h2 { margin: 0; font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; }
.packet-intro p { margin: 20px 0 0; color: #B8BCC3; font-size: 17px; }
.packet-list { flex: 999 1 560px; min-width: 0; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; counter-reset: step; }
.packet-list li { padding: 22px; counter-increment: step; }
.packet-list li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); color: var(--accent); font-size: 13px; }
.packet-list h3 { margin: 8px 0 6px; font-size: 19px; }
.packet-list p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Rules + community ---------- */
.duo { display: flex; flex-wrap: wrap; gap: 24px; padding-top: 24px; padding-bottom: 88px; }
.rules { flex: 1 1 460px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; background: rgba(20, 22, 27, 0.6); }
.rules h2 { margin: 0 0 18px; font-size: 28px; }
.rules ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; color: var(--text-2); }
.rules li { display: flex; gap: 12px; }
.rules li::before { content: ">"; font-family: var(--font-mono); color: var(--accent); }
.community { flex: 1 1 460px; min-width: 0; background: var(--accent); color: var(--on-accent); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.community .eyebrow { color: var(--on-accent); margin: 0; }
.community h2 { margin: 0; font-size: 34px; line-height: 1.1; }
.community p { margin: 0; font-size: 17px; flex-grow: 1; }
.community .btn { align-self: flex-start; background: var(--on-accent); color: var(--text); }
.community .btn:hover { background: #000; color: #fff; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid #23262D; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 36px; align-items: center; padding-top: 36px; padding-bottom: 36px; font-size: 14px; color: var(--muted); }
.site-footer .brand-name { font-size: 18px; color: var(--text); }
.site-footer .grow { flex-grow: 1; }
.site-footer a { color: var(--text-2); }

/* ---------- Page header ---------- */
.page-head { padding-top: 40px; padding-bottom: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; }
.page-head h1 { margin: 0; font-size: 44px; letter-spacing: -0.02em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.input, .select, .textarea { font: inherit; font-size: 15px; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px; padding: 11px 14px; min-height: 44px; }
.textarea { resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #7E838C; }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; cursor: pointer; }

/* ---------- Browse layout ---------- */
.layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; padding-bottom: 88px; }
.sidebar { flex: 1 1 270px; max-width: 100%; display: flex; flex-direction: column; gap: 20px; }
.results { flex: 999 1 620px; min-width: 0; }
.filter { margin: 0; padding: 20px 22px; }
.filter legend, .filter h2 { padding: 0 6px; margin: 0 0 0 -6px; font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.filter h2 { margin: 0; padding: 0; }
.check-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; cursor: pointer; font-size: 15px; }
.check-row .grow { flex-grow: 1; }
.count { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.game-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.game-btn { font: inherit; font-size: 15px; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px; cursor: pointer; color: var(--text); background: transparent; border: 1px solid transparent; text-align: left; min-height: 44px; }
.game-btn:hover { background: #1C1F25; }
.game-btn[aria-pressed="true"] { background: #262A31; border-color: var(--accent); font-weight: 600; }
.game-btn .grow { flex-grow: 1; }
.results-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; min-height: 38px; }
.chip { font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; background: #23262D; color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.link-btn { font: inherit; font-size: 13px; background: transparent; color: var(--accent); border: 0; padding: 6px 4px; cursor: pointer; text-decoration: underline; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 48px 24px; text-align: center; background: rgba(20, 22, 27, 0.8); }
.empty h2 { margin: 0 0 6px; font-size: 22px; }
.empty p { margin: 0 0 18px; color: var(--muted); }

/* ---------- Project page ---------- */
.crumbs { flex-grow: 1; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.project-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; padding-top: 40px; margin-bottom: 28px; }
.project-head h1 { margin: 0; font-size: 52px; line-height: 1.05; letter-spacing: -0.02em; }
.project-head .sub { margin: 8px 0 0; color: #B8BCC3; font-size: 18px; }
.byline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.player { overflow: hidden; }
.player-stage { aspect-ratio: 16 / 9; background: #2B3F30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.player-stage .hint { font-family: var(--font-mono); font-size: 12px; color: #C9D6CC; }
.player-meta { padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.main-col { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.side-col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.side-col .panel { padding: 22px; }
.side-col h2 { margin: 0 0 14px; font-size: 19px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { font: inherit; font-size: 15px; background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 12px 14px; margin-bottom: -1px; cursor: pointer; color: var(--muted); }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.tabpanel { padding: 26px; }
.tabpanel ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); }
.tabpanel p { margin: 0; color: var(--text-2); }
.code-block { margin: 0; background: #0E0F12; border: 1px solid var(--line); border-radius: 6px; padding: 18px; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; overflow-x: auto; }
.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; font-size: 14px; }
.prov-grid div { border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.prov-grid strong { display: block; margin-bottom: 4px; }
.lineage { margin: 0; padding: 0; list-style: none; }
.lineage li { display: flex; gap: 14px; }
.lineage .rail { display: flex; flex-direction: column; align-items: center; }
.lineage .node { width: 12px; height: 12px; border-radius: 50%; background: #6B7079; margin-top: 5px; }
.lineage .node.next { background: transparent; border: 2px dashed var(--accent); }
.lineage .line { width: 2px; flex-grow: 1; background: #343842; min-height: 28px; }
.lineage p { margin: 0; }
.lineage .who { font-weight: 600; }
.lineage .who.next { color: var(--accent); }
.lineage .when { font-size: 14px; color: var(--muted); padding-bottom: 14px; }
.details { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.mono { font-family: var(--font-mono); }

/* ---------- Blog ---------- */
.vote { padding: 32px; margin-bottom: 48px; border-color: var(--line-strong); }
.vote-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 24px; }
.vote-head h2 { margin: 0; font-size: 34px; line-height: 1.1; }
.vote-head p { margin: 12px 0 0; color: #B8BCC3; font-size: 17px; max-width: 640px; }
.vote-status { margin: 0; font-size: 15px; color: var(--s-active); }
.candidate { border: 2px solid var(--line); background: var(--panel-deep); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.candidate.voted { border-color: var(--accent); }
.candidate .shot { height: 96px; justify-content: space-between; }
.candidate h3 { margin: 0; font-size: 21px; }
.candidate .goal { margin: 0; color: var(--text-2); font-size: 15px; flex-grow: 1; }
.posts { display: flex; flex-direction: column; gap: 16px; }
.post { padding: 24px 26px; display: flex; flex-direction: column; gap: 10px; }
.post h3 { margin: 0; font-size: 24px; line-height: 1.2; }
.post p { margin: 0; color: var(--text-2); }
.post .byline { margin: 0; }
.topic { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #0E0F12; padding: 3px 8px; border-radius: 4px; background: var(--text-2); }
.topic[data-topic="Community project"] { background: var(--s-adopt); }
.topic[data-topic="Handoff story"] { background: var(--s-active); }
.topic[data-topic="Guide"] { background: var(--s-help); }
.side-form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.side-form h2 { margin: 0; font-size: 20px; }
.side-form p { margin: 0; font-size: 14px; color: var(--muted); }
.side-form label { font-size: 14px; color: var(--text-2); }
.side-form .input, .side-form .select, .side-form .textarea { background: #0E0F12; }
.side-panel { padding: 24px; }
.side-panel h2 { margin: 0 0 10px; font-size: 20px; }
.side-panel ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 15px; }
.side-panel p { margin: 0 0 10px; font-size: 15px; color: var(--muted); }
.form-note { font-size: 14px; color: var(--s-active); min-height: 1em; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
