/* shared by every page: theme, base controls, top bar, footer */
:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --fg: #ececec;
  --muted: #8c8c8c;
  --line: #262626;
  --panel: #141414;
  --accent: #78c16f;
  --on-accent: #000;
  --select: #78c16f;
  /* how wide the column of content is on every page */
  --column: 1040px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 18px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
::selection {
  background: var(--accent);
  color: var(--on-accent);
}
a {
  color: var(--accent);
}
button,
input,
select {
  font: 14px/1 inherit;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
}
button {
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}
button:hover {
  border-color: var(--accent);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
[hidden] {
  display: none !important;
}
/* bigger tap targets on touch screens; 16px inputs stop iOS zooming in on focus */
@media (pointer: coarse) {
  button,
  input,
  select {
    font-size: 16px;
    min-height: 40px;
  }
}

#header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
#topbar {
  display: flex;
  align-items: center;
  /* the title, menu and bell sit together in the middle of the bar */
  justify-content: center;
  gap: 16px;
  padding: 10px 16px;
}
#topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
#topbar .brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
/* The menu sits right beside the title, split off by a thin line: "Title | Menu".
   The links scroll sideways if a very narrow screen still can't fit them all. */
#topbar .links {
  display: flex;
  gap: 4px;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
#topbar .links a {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  transition:
    color 0.12s,
    background-color 0.12s;
}
#topbar .links a:hover {
  background: var(--line);
  color: var(--fg);
}
/* the page you are on: tinted, not a solid block, so it doesn't shout over the title */
#topbar .links a[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
  font-weight: 600;
}

.bellBox {
  position: relative;
  display: flex;
}
#bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
}
#bell:hover,
#bell[aria-expanded="true"] {
  color: var(--fg);
}
#bell svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* how many are new */
#bellCount {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}
#bellPanel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.6);
}
#bellPanel p {
  margin: 0;
  padding: 14px 10px;
}
.bellItem {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.bellItem:hover {
  background: var(--line);
}
/* ones that arrived since the list was last opened */
.bellItem.unread {
  box-shadow: inset 3px 0 0 var(--accent);
}
.bellItem small {
  color: var(--muted);
  font-size: 12px;
}

/* shown in place of the page for the moment between clicking a menu link and the next page arriving */
body.navigating > :not(#header):not(#skeleton) {
  display: none !important;
}
#skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: var(--column);
  margin: 0 auto;
  padding: 48px 16px;
}
#skeleton div {
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--line) 25%, #333 37%, var(--line) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
#skeleton div:first-child {
  height: 34px;
  margin-bottom: 8px;
}
@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  #skeleton div {
    animation: none;
  }
}

/* on phones the links get their own row under the title, and the dividing line is dropped */
@media (max-width: 560px) {
  #topbar {
    flex-wrap: wrap;
    row-gap: 6px;
    padding: 8px 12px;
  }
  #topbar {
    justify-content: space-between;
  }
  /* title and bell share the first row; the links take the second */
  #topbar .links {
    order: 3;
    width: 100%;
    gap: 0;
    padding-left: 0;
    border-left: 0;
    justify-content: space-between;
  }
  #topbar .links a {
    padding: 6px 4px;
    font-size: 13px;
  }
}

/* plain text pages and the placeholder views */
.page {
  max-width: var(--column);
  min-height: 60vh;
  margin: 0 auto;
  padding: 40px 16px 64px;
  overflow-wrap: break-word;
}
.page h1,
.page h2 {
  line-height: 1.25;
}
.page h2 {
  margin-top: 2em;
  font-size: 1.2em;
}
.muted {
  color: var(--muted);
  font-size: 0.85em;
}

footer {
  display: flex;
  gap: 16px;
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 16px 32px;
  font-size: 13px;
}
footer a {
  color: var(--muted);
}
