:root {
  color-scheme: dark;
  --bg: #0c0f12;
  --panel: #151a1f;
  --panel-2: #11161b;
  --line: #2b343c;
  --text: #f1f5f4;
  --muted: #a8b3ad;
  --accent: #d7ff68;
  --accent-2: #5ee0c2;
  --accent-3: #8ca7ff;
  --warm: #ffba4a;
  --danger: #ff6d6d;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(94, 224, 194, 0.08), transparent 360px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 0 18px;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(12, 15, 18, 0));
}

.topbar a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.topbar a:hover,
.topbar .city-link:hover {
  border-color: var(--accent-2);
}

.topbar .city-link {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.hero {
  min-height: 340px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: end;
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: 22px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.city-cta {
  min-width: 132px;
  background: var(--accent-2);
  color: #07110f;
}

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

.status-panel {
  padding: 20px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 18px currentColor;
}

.status-dot.online {
  background: var(--accent-2);
}

dl {
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
}

dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
}

.panel {
  padding: 22px;
}

.registry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.registry div {
  min-height: 92px;
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.registry span,
.services span,
.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.registry strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
}

.services {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.services li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.services li:last-child {
  border-bottom: 0;
}

.services b {
  color: var(--accent);
  font-size: 13px;
}

.feed-panel {
  margin-top: 18px;
}

.summary-panel {
  margin-top: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.feed {
  display: grid;
  gap: 12px;
}

.event {
  padding: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.event time {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.event pre,
.event p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.intake-grid {
  align-items: start;
}

.form-stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(94, 224, 194, 0.12);
}

button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #12150f;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.ghost-button:hover {
  border-color: var(--accent-3);
}

.form-note {
  min-height: 20px;
  margin: 0;
  color: var(--accent-2);
  font-size: 13px;
}

.city-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: #000;
}

.gate-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid #262626;
  background: #050505;
  color: #f4f4f4;
  font-size: 24px;
  line-height: 1;
}

.house-button {
  width: min(58vw, 360px);
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 32px rgba(255, 186, 74, 0.22));
}

.house-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.house-button:hover {
  filter: drop-shadow(0 0 42px rgba(255, 186, 74, 0.38));
}

.city-social {
  margin: 22px 0 18px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.social-sidebar,
.social-main {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.social-sidebar {
  position: sticky;
  top: 64px;
  padding: 20px;
}

.relay-stack {
  display: grid;
  gap: 10px;
}

.relay-chip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.relay-chip b {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--danger);
}

.relay-chip.online b {
  background: var(--accent-2);
}

.social-main {
  padding: 20px;
}

.social-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 14px;
}

.social-head h2 {
  margin-bottom: 6px;
}

.social-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.note-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.social-feed {
  display: grid;
  gap: 12px;
}

.social-note {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.social-note header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.social-avatar {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #08100e;
  font-weight: 900;
  text-transform: uppercase;
}

.social-author {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-note time,
.social-note footer {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.social-note p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.social-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.social-media-grid img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #050709;
}

.social-media-grid:has(img:only-child) img {
  object-fit: contain;
}

.social-note footer {
  margin-top: 10px;
}

.admin-hero {
  min-height: 280px;
}

.admin-submission {
  display: grid;
  gap: 10px;
}

.status-line {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
}

.status-form {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 24px, 720px);
    padding-top: 18px;
  }

  .hero,
  .grid,
  .city-social {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 28px;
  }

  h1 {
    font-size: 48px;
  }

  .lead {
    font-size: 17px;
  }

  .registry {
    grid-template-columns: 1fr;
  }

  .city-social {
    margin-top: 16px;
  }

  .social-sidebar {
    position: static;
  }

  .social-head,
  .note-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .house-button {
    width: min(78vw, 320px);
  }
}
