/* the homepage's lettering, served from the site root */
@font-face {
  font-family: "Umoupen Brush";
  font-weight: 400;
  font-display: block;
  src: url("/umoupen-brush.woff2?v=4") format("woff2");
}

:root {
  color-scheme: light dark;
  --bg: #fbfcff;
  --card: #ffffff;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-wash: rgb(59 130 246 / 0.16);
  --text: #171b26;
  --text-soft: #4b5567;
  --text-muted: #737d90;
  --border: #d8deea;
  --hover: rgb(23 27 38 / 0.06);
  --shadow: 0 1px 2px rgba(23, 27, 38, 0.06), 0 12px 32px -8px rgba(23, 27, 38, 0.22);
  --page-top: oklch(0.977 0.010 252);
  --page-bottom: oklch(0.952 0.022 252);
  --hatch: rgb(61 135 255 / 0.08);
  --close: #e62e38;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e14;
    --card: #1a1e2e;
    --text: #e8eaf0;
    --text-soft: #9ca3b4;
    --text-muted: #6b7280;
    --border: #2a2f42;
    --hover: rgb(255 255 255 / 0.06);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 36px -8px rgba(0, 0, 0, 0.6);
    --page-top: oklch(0.20 0.035 260);
    --page-bottom: oklch(0.27 0.058 260);
    --hatch: rgb(61 135 255 / 0.035);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--page-top);
  color: var(--text);
  font: 14px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* moving stripes, same as the homepage */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background: linear-gradient(var(--page-top), var(--page-bottom));
}

body::after {
  left: -18px;
  background: repeating-linear-gradient(135deg, var(--hatch) 0 1.414px, transparent 1.414px 12.728px);
  mask-image: linear-gradient(transparent, #000);
  animation: stripes 0.6s linear infinite;
}

@keyframes stripes {
  to { translate: 18px 0; }
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
  }
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

svg.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: currentColor;
}

[hidden] {
  display: none !important;
}

/* header */

.world-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 28px 10px;
  font-size: 22px;
}

.world-header svg.icon {
  width: 24px;
  height: 24px;
}

.home img {
  display: block;
  width: 30px;
  height: 30px;
}

.world-title {
  font-family: "Umoupen Brush", var(--font);
  font-size: 30px;
  line-height: 1;
  text-decoration: none;
}

.account {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  font-size: 14px;
  color: var(--text-soft);
}

.account a,
.account .link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.account a:hover,
.account .link:hover {
  color: var(--text);
}

.account form {
  display: inline;
}

/* the signed-in member's picture beside their name */
.account .account-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account .account-name .avatar.header {
  display: block;
  width: 26px;
  height: 26px;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
}

/* language menu */

.language {
  position: relative;
}

.language summary {
  list-style: none;
  white-space: nowrap;
  cursor: pointer;
}

.language summary::-webkit-details-marker {
  display: none;
}

.language summary::after {
  content: " ▾";
}

.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 5;
  display: grid;
  min-width: 140px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.language-menu a {
  padding: 6px 10px;
  border-radius: 8px;
}

.language-menu a[aria-current=true] {
  background: var(--accent-wash);
}

main {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* sidebar */

.sidebar {
  display: flex;
  flex-direction: column;
  width: 300px;
  flex: none;
  padding: 8px 14px 24px 22px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.sidebar > * {
  flex: none;
}

.sidebar h3 {
  margin: 18px 10px 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.segmented {
  display: flex;
  margin: 4px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
}

.segmented > * {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  text-align: center;
  text-decoration: none;
  color: var(--text-soft);
}

.segmented > :hover {
  background: var(--hover);
}

.segmented svg.icon {
  width: 15px;
  height: 15px;
}

.segmented > .selected {
  border-color: var(--accent);
}

.segmented.small > * {
  padding: 4px 2px;
  font-size: 13px;
}

.side-more-button {
  display: none;
}

.search {
  width: calc(100% - 8px);
  margin: 2px 4px 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font: inherit;
  color: var(--text);
}

.search:focus {
  outline: none;
  border-color: var(--accent);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 36px;
  margin: 2px 0;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  text-align: left;
  text-decoration: none;
}

.row:hover {
  background: var(--hover);
}

.row.selected {
  background: var(--accent-wash);
}

.count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.row .label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.new-topic {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px 4px 10px;
  height: 38px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.sidebar .new-topic:hover {
  background: var(--accent-hover);
  color: #fff;
}

.sidebar-pinned {
  position: sticky;
  bottom: -24px;
  margin: auto -14px -24px -22px;
  padding: 8px 14px 12px 22px;
  border-top: 1px solid var(--border);
  background: var(--page-top);
}

.note {
  margin: 4px 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.sidebar a:hover {
  color: inherit;
  text-decoration: none;
}

/* narrow windows */

@media (max-width: 820px) {
  main {
    flex-direction: column;
    overflow-y: auto;
  }

  .side-more-button {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 4px 4px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    cursor: pointer;
  }

  .side-rows,
  .sidebar-pinned {
    display: none;
  }

  .side-more:checked ~ .side-rows,
  .side-more:checked ~ .sidebar-pinned {
    display: block;
  }

  .sidebar-pinned {
    position: static;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
  }

  .side-more:checked + .side-more-button {
    border-color: var(--accent);
  }

  .world-header {
    flex-wrap: wrap;
    padding: 16px 16px 8px;
  }

  .world-title {
    font-size: 24px;
  }

  .sidebar {
    display: block;
    width: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}
