:root {
  color-scheme: dark;
  --bg: #000;
  --fg: #d6d6d6;
  --muted: #8a8a8a;
  --line: #222;
  --danger: #fff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 "Segoe UI", system-ui, sans-serif;
}

:root { --art: 44vw; }

body {
  min-height: 100vh;
}

#stage {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--art);
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

#art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

body[data-room="home"] #art { object-position: 46% 55%; }
body[data-room="news"] #art { object-position: 28% 72%; }
body[data-room="engagements"] #art { object-position: center center; }
body[data-room="faq"] #art { object-position: 42% 52%; }
body[data-room="admin"] #art { object-position: 86% center; }
body[data-room="missing"] #art { object-position: center 62%; }

#stage::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 28px;
  background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
}

.sheet {
  position: relative;
  z-index: 1;
  width: calc(100% - var(--art));
  min-height: 100vh;
  margin: 0;
  padding: 40px 44px 80px;
  background: var(--bg);
}

@media (max-width: 860px) {
  :root { --art: 100%; }
  #stage {
    position: relative;
    width: 100%;
    height: 46vh;
    min-height: 240px;
    bottom: auto;
  }
  #stage::before {
    top: auto;
    width: 100%;
    height: 52px;
    background: linear-gradient(to top, var(--bg), transparent);
  }
  #art,
  body[data-room] #art { object-position: center center; }
  .sheet {
    width: 100%;
    min-height: 0;
    padding: 22px 16px 64px;
  }
}

.sheet :where(p, a, h2, .ptitle, .ask, label, .hint, .handle, .kicker) {
  text-shadow: 0 1px 18px #000;
}

a { color: #fff; }

button, input, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 2px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.look-wrap { position: relative; }

.look-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

.look-btn img {
  display: block;
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.look-btn[aria-expanded="true"] img {
  outline: 1px solid #fff;
  outline-offset: 2px;
}

.look {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 4;
  width: 268px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.look-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.choices { margin-bottom: 14px; }
.look .choices:last-child { margin-bottom: 0; }

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choices button {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  font: inherit;
}

.choices button.is-on {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

html[data-font="sans"] body { font-family: "Segoe UI", system-ui, sans-serif; }
html[data-font="serif"] body { font-family: Georgia, "Palatino Linotype", Palatino, serif; }
html[data-font="mono"] body { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; }

html[data-style="code"] body {
  font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.55;
}

html[data-style="code"] .kicker,
html[data-style="code"] .brand,
html[data-style="code"] .look-label {
  letter-spacing: 0.04em;
}

html[data-theme="sobre"] {
  --bg: #12110f;
  --fg: #e7e2d6;
  --muted: #9c978c;
  --line: #2c2a26;
}

html[data-theme="brume"] {
  --bg: #0c0c0c;
  --fg: #f3f3f3;
  --muted: #a3a3a3;
  --line: #303030;
}

.choices [data-value="serif"] { font-family: Georgia, "Palatino Linotype", Palatino, serif; }
.choices [data-value="mono"] { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; }
.choices [data-value="sans"] { font-family: "Segoe UI", system-ui, sans-serif; }

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav a:hover { color: #fff; }

nav a.is-on {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.kicker {
  margin: 0 0 14px;
  color: #bdbdbd;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.lead {
  margin: 0 0 10px;
  color: #fff;
  font-size: 16px;
}

p { margin: 0 0 10px; }

.quiet { color: var(--muted); }

.pledges {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.pledges li {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.pledges h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.pledges p { margin: 0; }

.handle-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.support-label { margin: 26px 0 0; }

.notice {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
}

.notice[hidden] { display: none; }

.notice-card {
  width: min(440px, 100%);
  padding: 22px 22px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
}

.notice-ok {
  display: inline-block;
  margin-top: 6px;
  padding: 11px 16px;
  background: #fff;
  color: #000;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.notice-ok:hover { background: #dcdcdc; }

.handle { color: #fff; }

a.tg {
  display: inline-block;
  padding: 11px 16px;
  background: #fff;
  color: #000;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
}

a.tg:hover { background: #dcdcdc; }
a.tg { text-shadow: none; }

.btn {
  display: inline-block;
  padding: 6px 10px;
  background: #000;
  border: 1px solid #333;
  color: var(--fg);
  text-decoration: none;
}

.btn:hover { border-color: #fff; color: #fff; }

.btn.primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.btn.primary:hover { color: #000; }

.btn.danger:hover { border-color: #fff; color: #fff; background: #111; }

.posts, .asks, .admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-open, .ask, .admin-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #1a1a1a;
  padding: 12px 0;
  color: var(--fg);
}

.post-open:hover .ptitle,
.ask:hover { color: #fff; }

.ptitle { display: block; color: #fff; }

.pmeta, .tag, .pdate {
  font-size: 12px;
  color: var(--muted);
}

.pmeta { display: block; margin-bottom: 4px; }

.pexcerpt { display: block; margin-top: 4px; color: var(--muted); }

.article-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.article-title {
  margin: 0 0 8px;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.article-body {
  white-space: pre-wrap;
  color: var(--fg);
}

.ask { display: block; color: #fff; }

.ask .mark { margin-right: 8px; color: var(--muted); }

.answer {
  margin: 0 0 12px;
  padding: 0 0 8px 12px;
  border-left: 1px solid #333;
  color: var(--fg);
}

.field { margin: 0 0 12px; }

.field label, .check {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  background: #000;
  border: 1px solid #333;
  padding: 8px 10px;
}

textarea { min-height: 140px; resize: vertical; }

input:focus, textarea:focus { border-color: #fff; outline: none; }

.split { display: flex; gap: 10px; }

.split .field { flex: 1; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  color: var(--fg);
  font-size: 15px;
}

.check input { accent-color: #fff; }

.actions, .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions { margin: 4px 0 16px; }

.err { color: #fff; }

.ok { color: #fff; }

.tabs {
  display: flex;
  gap: 16px;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
}

.tabs button.is-on { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

.admin-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
}

hr.dim {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px 0 14px;
}

.hint { margin: -4px 0 12px; color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  .top { flex-direction: column; align-items: flex-start; }
  .split { flex-direction: column; gap: 0; }
  .admin-item { grid-template-columns: 1fr; }
}
