/* Project7825 staff handbook. Colours and type follow the brand kit (brand/README.txt). */
:root {
  --ink: #0b0d1a;
  --paper: #f5f3ee;
  --cobalt: #3d6bff;
  --slate: #1a1e33;
  --mist: #9aa0b8;
  --yolk: #ffd23f;

  --bg: var(--ink);
  --surface: var(--slate);
  --surface-2: #232842;
  --border: #2a2f4a;
  --text: var(--paper);
  --text-2: #c9cddb;
  --muted: var(--mist);
  --link: #7c9bff;
  --accent: var(--cobalt);
  /* Height of the sticky header: one row on wide screens, two once the section buttons wrap below. */
  --head: 60px;
  --pad: 20px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: var(--paper);
    --surface: #ffffff;
    --surface-2: #ebe8e1;
    --border: #dcd8cf;
    --text: var(--ink);
    --text-2: #33374d;
    --muted: #5f6680;
    --link: #2448d6;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Rubik", system-ui, sans-serif;
}
a { color: var(--link); }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-weight: 800; font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; letter-spacing: -0.03em; }
.lead { color: var(--muted); font-size: 18px; margin: 0 0 24px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- buttons, pills ---------- */
.button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 12px; border: 0;
  background: var(--cobalt); color: #fff; font: 500 16px "Rubik", sans-serif; text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.1); }
.button.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.button.discord { background: #5865f2; font-size: 17px; padding: 14px 24px; }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.link-button:hover { color: var(--text); }
.pill {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; vertical-align: 2px;
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text);
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em; text-transform: none; white-space: nowrap;
}
.pill.muted { background: var(--surface-2); color: var(--muted); }
.pill.audience { background: color-mix(in srgb, var(--yolk) 22%, transparent); }
.viewer { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
.viewer strong { color: var(--text); font-weight: 500; }
.notice { background: color-mix(in srgb, var(--yolk) 18%, transparent); border-radius: 10px; padding: 10px 14px; color: var(--text); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px;
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; height: 60px; color: var(--text); text-decoration: none; }
.brand .mark { height: 28px; width: auto; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.035em; text-transform: lowercase; }
.brand-name b { color: var(--cobalt); }
.brand-tag { color: var(--muted); font-size: 13px; padding-left: 10px; border-left: 1px solid var(--border); }
/* Section buttons: the server's own pages first, then one button per shared category. */
.tabs { display: flex; align-items: center; gap: 4px; height: 60px; min-width: 0; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; white-space: nowrap;
  color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 14px;
}
.tab:hover { background: var(--surface); color: var(--text); }
.tab.active { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
.server-tab-group { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; padding-right: 10px; border-right: 1px solid var(--border); }
.server-tab { padding-left: 6px; font-weight: 700; }
.switch { padding: 6px 8px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.switch:hover { background: var(--surface); color: var(--text); }
.sidebar-heading { margin: 0 0 10px; padding: 0 10px; font-size: 17px; font-weight: 700; color: var(--text); }
.spacer { flex: 1; }
.search input {
  width: 260px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: 14px "Rubik", sans-serif;
}
.search.big input { width: 100%; font-size: 17px; padding: 12px 16px; margin-bottom: 16px; }
.user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user form { margin: 0; }
.avatar { border-radius: 50%; }
.nav-toggle { display: none; }

.server-icon { border-radius: 30%; flex: none; object-fit: cover; }
.server-icon.initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }

/* ---------- landing ---------- */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.landing-card { max-width: 520px; text-align: center; position: relative; z-index: 1; padding-bottom: 120px; }
.landing-card h1 { margin-top: 20px; }
.landing-card p { color: var(--text-2); }
.landing-card .fine { color: var(--muted); font-size: 14px; margin-top: 16px; }

/* The peekers: cat heads peeking up from the bottom edge. One Cobalt cat is side-eyeing you. */
.peekers { position: absolute; bottom: 0; right: 8%; display: flex; gap: 14px; align-items: flex-end; pointer-events: none; }
.peekers span {
  --h: 80px; width: 90px; height: var(--h); background: var(--surface); position: relative; border-radius: 6px 6px 0 0;
}
.peekers span:nth-child(2) { --h: 130px; }
.peekers span:nth-child(3) { --h: 100px; }
.peekers span::before, .peekers span::after {
  content: ""; position: absolute; top: -24px; width: 30px; height: 30px; background: var(--surface);
  clip-path: polygon(20% 0, 100% 100%, 0 100%);
}
.peekers span::before { left: 0; }
.peekers span::after { right: 0; transform: scaleX(-1); }
.peekers .accent {
  background: var(--cobalt);
  background-image:
    radial-gradient(circle at 36% 30%, var(--ink) 0 5px, transparent 5.5px),
    radial-gradient(circle at 70% 30%, var(--ink) 0 5px, transparent 5.5px),
    radial-gradient(ellipse 11px 7px at 32% 31%, var(--paper) 0 99%, transparent),
    radial-gradient(ellipse 11px 7px at 66% 31%, var(--paper) 0 99%, transparent);
}
.peekers .accent::before, .peekers .accent::after { background: var(--cobalt); }
.peekers.small { position: static; justify-content: center; margin-bottom: 8px; }
.peekers.small span { --h: 60px; width: 70px; }
.peekers.small span::before, .peekers.small span::after { top: -18px; width: 22px; height: 22px; }
.landing .peekers { right: 50%; transform: translateX(50%); }

/* ---------- picker ---------- */
.picker { max-width: 920px; margin: 0 auto; padding: 56px 24px; }
.server-grid { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.server-card {
  display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 16px; height: 100%;
  background: var(--surface); color: var(--text); text-decoration: none; box-shadow: inset 0 0 0 1px var(--border);
  position: relative;
}
.server-card:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.server-card-body { display: flex; flex-direction: column; min-width: 0; }
.server-card-body span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.server-card .pill { position: absolute; top: 10px; right: 10px; }
.empty { background: var(--surface); border-radius: 16px; padding: 20px 24px; color: var(--text-2); }

/* ---------- handbook shell ---------- */
.shell { display: grid; grid-template-columns: 270px minmax(0, 1fr) 220px; max-width: 1440px; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--head); height: calc(100vh - var(--head)); overflow-y: auto;
  padding: 24px 16px 40px 20px; border-right: 1px solid var(--border); font-size: 15px;
}
.nav-home { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; margin-bottom: 12px; }
.nav-section { margin-bottom: 18px; }
.nav-title { margin: 0 0 6px; padding: 0 10px; font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.sidebar ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; line-height: 1.4; }
.sidebar a:hover { background: var(--surface); color: var(--text); }
.sidebar a.active { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--text); font-weight: 500; }

.content { padding: 40px 48px 96px; min-width: 0; }
.doc { max-width: 760px; }
.crumbs { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.crumbs .pill { margin-left: 10px; }

.toc { position: sticky; top: var(--head); height: calc(100vh - var(--head)); overflow-y: auto; padding: 40px 20px; font-size: 14px; }
.toc a { display: block; padding: 3px 0; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--text); }
.toc .d3 a { padding-left: 12px; }

.server-hero { display: flex; gap: 20px; align-items: center; margin-bottom: 8px; }
.server-hero h1 { margin: 0; }
.server-hero .lead { margin: 4px 0 0; }

.card-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card-list a {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 18px; border-radius: 14px;
  background: var(--surface); color: var(--text); text-decoration: none; box-shadow: inset 0 0 0 1px var(--border);
}
.card-list a:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.card-list span:not(.pill) { color: var(--muted); font-size: 14px; line-height: 1.45; }

.results { list-style: none; padding: 0; }
.results li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.results a { font-size: 18px; text-decoration: none; }
.results p { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
mark { background: color-mix(in srgb, var(--yolk) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- prose ---------- */
.prose { color: var(--text-2); }
.prose h2 { color: var(--text); font-size: 26px; margin: 44px 0 12px; font-weight: 700; }
.prose h3 { color: var(--text); font-size: 20px; margin: 32px 0 8px; font-weight: 700; }
.prose h4 { color: var(--text); font-size: 17px; margin: 24px 0 6px; }
.prose strong { color: var(--text); }
.prose .anchor { margin-left: 8px; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.prose :is(h2, h3, h4):hover .anchor { opacity: 1; }
.prose :is(h2, h3, h4) { scroll-margin-top: calc(var(--head) + 20px); }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
.prose code { font-family: ui-monospace, "Cascadia Code", Menlo, monospace; font-size: 0.9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--surface); padding: 16px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 20px 0; padding: 4px 18px; border-left: 4px solid var(--border); color: var(--muted); }
.prose .callout { border-left-width: 4px; border-radius: 0 12px 12px 0; padding: 12px 18px; background: var(--surface); color: var(--text-2); }
.prose .callout p { margin: 4px 0; }
.prose .callout-title { font-weight: 700; color: var(--text); font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.prose .callout-note { border-color: var(--cobalt); }
.prose .callout-tip { border-color: #2fbf71; }
.prose .callout-important { border-color: #a46bff; }
.prose .callout-warning { border-color: var(--yolk); }
.prose .callout-caution { border-color: #ff5a5a; }
.table-wrap { overflow-x: auto; margin: 20px 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--text); background: var(--surface); font-weight: 500; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:is([align="center"]), .prose th:is([align="center"]) { text-align: center; }

/* ---------- message pages ---------- */
.message { max-width: 560px; margin: 0 auto; padding: 96px 24px; text-align: center; }
.message .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 1500px) {
  .brand-tag { display: none; }
  .search input { width: 200px; }
}
@media (max-width: 1360px) {
  :root { --head: 109px; }
  .tabs {
    order: 99; flex-basis: calc(100% + 2 * var(--pad)); margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad);
    height: 48px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--border);
  }
  .tabs::-webkit-scrollbar { display: none; }
}
@media (max-width: 1180px) {
  .shell { grid-template-columns: 250px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  :root { --pad: 12px; }
  .topbar { column-gap: 10px; }
  .user-name { display: none; }
  .search input { width: 140px; }
  .nav-toggle:not([hidden]) {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none;
    border: 0; border-radius: 8px; background: var(--surface); cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    display: block; width: 16px; height: 2px; background: var(--text); position: relative; content: "";
  }
  .nav-toggle span::before { position: absolute; top: -5px; }
  .nav-toggle span::after { position: absolute; top: 5px; }
  .shell { display: block; }
  .sidebar {
    position: fixed; top: var(--head); left: 0; z-index: 15; width: min(300px, 85vw); background: var(--bg);
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.5); }
  .content { padding: 28px 16px 72px; }
}
@media (max-width: 560px) {
  .brand-name { display: none; }
  .search input { width: 120px; }
}
