:root {
  --bg: #0c0c0c;
  --card: #101012;
  --card-head: #111111;
  --card-body: #0b0b0b;
  --deep: #060607;
  --fg: #e6e6e6;
  --muted: #6b6b6b;
  --line: #252525;
  --line-hi: #3a3a3a;
  --green: #4ade80;
  --green-dark: #2c6b43;
  --blue: #60a5fa;
  --err: #f87171;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--fg); margin: 0; min-height: 100%; }
/* Hide the page scrollbar on the right — scrolling still works via wheel / trackpad / touch. */
html, body { scrollbar-width: none; }                                      /* Firefox */
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* Chrome / Edge / Safari */
body {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  padding: 32px 20px 60px;
}
.wrap { max-width: 780px; margin: 0 auto; }
.wrap.wide { max-width: none; margin: 0; }   /* Oculus: full width so the sidebar hugs the far-left corner */
.wrap.home { max-width: none; margin: 0; }   /* home: full-width, stacked sections (not centered, not the oculus shell) */

/* ---------- Header ---------- */
header {
  display: flex;
  justify-content: space-between;
  /* v1.0 / date hang from the bottom of the header so the last line sits
     on the subtitle's baseline instead of the title's. */
  align-items: flex-end;
  gap: 16px;
}
.head-left { display: flex; gap: 12px; align-items: flex-start; }
.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 9px;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.9), 0 0 16px rgba(96, 165, 250, 0.6), 0 0 28px rgba(96, 165, 250, 0.4);
  flex-shrink: 0;
}
.site-name {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.site-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.18em;
  margin-top: 4px;
  text-transform: uppercase;
}
.head-right {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  flex-shrink: 0;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

/* ---------- Comment note ---------- */
.note {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.55;
  background: rgba(96, 165, 250, 0.04);
  border-left: 3px solid var(--blue);
  color: var(--blue);
  word-wrap: break-word;
}
.note .c { opacity: 0.55; }

/* ---------- Section title (used inside cards) ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 12px;
  text-transform: uppercase;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Section heading with a trailing rule running to the right edge (Oculus page). */
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 26px 0 14px;
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Card ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 14px;
  background: var(--card);
  /* Padding is handled by internal sections so dividers can span edge-to-edge */
  padding: 0;
  overflow: hidden;
}
.card-head {
  background: var(--card-head);
  padding: 20px 22px;
}
.card-head .badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-head .path {
  font-size: 15px;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.card-desc {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
  font-family: var(--sans);
}
.card-section {
  padding: 20px 22px;
  border-top: 1px solid var(--line);
  background: var(--card-body);
}

/* ---------- Method badges ---------- */
.badge.method {
  display: inline-block;
  border: 1px solid;
  background: rgba(255, 255, 255, 0.02);
  padding: 3px 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  border-radius: 5px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
  min-width: 52px;
  text-align: center;
}
.badge.method.get    { border-color: var(--blue); color: var(--blue); background: #1e3a5f; }
.badge.method.post   { border-color: var(--blue); color: var(--blue); background: #1e3a5f; }
.badge.method.put    { border-color: #fbbf24;      color: #fbbf24;      background: rgba(251, 191, 36, 0.06); }
.badge.method.patch  { border-color: #a78bfa;      color: #a78bfa;      background: rgba(167, 139, 250, 0.06); }
.badge.method.delete { border-color: var(--err);   color: var(--err);   background: rgba(248, 113, 113, 0.06); }
.badge.method.head   { border-color: var(--muted); color: var(--muted); background: rgba(255, 255, 255, 0.03); }

/* ---------- Fields ----------
   Field / label / input sizes below are UNIFORM across every page —
   the same label size, the same input height everywhere — so the
   whole site reads as one style. */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}
input[type="text"], input[type="url"], input[type="number"], select, textarea {
  width: 100%;
  /* Input backgrounds sit one step lighter than the card body so the
     field edges read clearly against the surrounding card. */
  background: #111111;
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 8px 13px;
  font: inherit;
  border-radius: 4px;
  outline: none;
}
input::placeholder, textarea::placeholder { color: #4a4a4a; }
input:focus, select:focus, textarea:focus { border-color: var(--line-hi); }
textarea { min-height: 72px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.row:last-child { margin-bottom: 0; }
.row .field { margin-bottom: 0; }
.check { display: flex; align-items: center; gap: 8px; color: var(--fg); font-size: 13px; }
.check input { width: auto; margin: 0; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.hint.err-hint { color: var(--err); }

/* ---------- Buttons ----------
   Every .btn on the site is the SAME size so the whole site reads
   as one style. */
button.btn {
  background: #181818;
  color: var(--fg);
  border: 1px solid #2e2e2e;
  padding: 7px 20px;
  font: inherit;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
button.btn:hover:not(:disabled) { border-color: #3d3d3d; background: #1f1f1f; transform: translateY(-1px); }
button.btn:active:not(:disabled) { transform: translateY(1px); }
button.btn.params { margin-left: auto; }
.btn[data-oc], .btn[data-params] { min-width: 150px; }
button.btn:disabled { opacity: 0.4; cursor: not-allowed; }
button.btn.err { border-color: rgba(248, 113, 113, 0.5); color: var(--err); }
button.btn.err:hover:not(:disabled) { border-color: var(--err); background: rgba(248, 113, 113, 0.06); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Stats ---------- */
.stats { display: flex; gap: 36px; flex-wrap: wrap; }
.stat .k { color: var(--muted); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; }
.stat .v { font-size: 22px; margin-top: 4px; }
.stat.err .v { color: var(--err); }

/* ---------- Log ---------- */
.log-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.log-bar .k { color: var(--muted); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; }
.log {
  /* Log panel blends with the card body (the box's bottom-half colour). */
  background: var(--card-body);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 11px;
  color: #888888;
  /* Grow with content up to a cap, then scroll — so a lone "fetching..."
     line renders as one row instead of a big empty box. */
  max-height: 220px;
  overflow: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-all;
  contain: content;
  overflow-anchor: none;
}
.log .err { color: #888888; }
.log .info { color: #888888; }
@keyframes logIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.log > div { animation: logIn 0.2s ease; }

/* ---------- User search: rendered cards with avatar ---------- */
.user-results { display: flex; flex-direction: column; gap: 10px; }
.user-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px; border: 1px solid var(--line); border-radius: 6px;
  background: rgba(255, 255, 255, 0.015);
}
.user-avatar {
  width: 84px; height: 84px; flex: 0 0 84px;
  border-radius: 6px; object-fit: cover;
  background: #1a1a1a; border: 1px solid var(--line);
}
.user-avatar-fallback {
  width: 84px; height: 84px; flex: 0 0 84px;
  border-radius: 6px; background: #1a1a1a; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 10px; letter-spacing: 0.1em;
}
.user-info {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 2px 12px; align-items: baseline; min-width: 0; flex: 1;
}
.user-key {
  color: var(--muted); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.user-val { color: var(--fg); font-size: 12px; word-break: break-all; }
/* Blacklist rows in the admin panel */
.bl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: var(--fg);
}
.bl-row + .bl-row { border-top: 1px solid var(--line); }
button.mini {
  background: transparent; color: var(--fg);
  border: 1px solid var(--line);
  padding: 3px 11px;
  font: inherit; font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
}
button.mini:hover { border-color: var(--line-hi); background: rgba(255,255,255,0.02); }

/* ---------- Footer ---------- */
footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
footer .right { text-align: right; }

/* ---------- Hub ---------- */
.hub-links { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.hub-links a {
  display: block;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px 20px;
  background: var(--card);
}
.hub-links a:hover { border-color: var(--line-hi); }
.hub-links a .path { font-size: 15px; }
.hub-links a .desc { color: var(--muted); font-size: 12px; margin-top: 6px; font-family: var(--sans); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-right: 8px;
  vertical-align: 2px;
}
.badge.tool { border: 1px solid var(--blue); color: var(--blue); background: #1e3a5f; font-family: var(--mono); letter-spacing: normal; }

/* ---------- Flat single-colour info cards (About Me / Friends) ---------- */
.card.flat .card-section { background: var(--card); border-top: 0; }
.box-title { font-size: 15px; color: var(--fg); margin-bottom: 10px; }
.about { color: var(--fg); font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.friends-intro { color: var(--muted); font-family: var(--sans); font-size: 13px; margin-bottom: 12px; }
.friend { color: var(--muted); font-family: var(--mono); font-size: 13px; padding: 6px 0; }
.friend + .friend { border-top: 1px solid var(--line); }
.friend-name { color: #fff; font-family: var(--mono); }

/* ---------- Hover animation on boxes + selection colour ---------- */
.card, .hub-links a, .friend-card { transition: transform 0.15s ease, border-color 0.15s ease; }
.card:hover, .hub-links a:hover, .friend-card:hover {
  transform: translateY(-4px);
}
.friend-card:hover { border-color: var(--line-hi); }
::selection { background: #15325f; color: #dce9ff; }
::-moz-selection { background: #15325f; color: #dce9ff; }

.hidden { display: none; }

/* Auth-gate / login-overlay styles removed along with the login wall. */
@media (max-width: 500px) {
  .row { grid-template-columns: 1fr; }
  .stats { gap: 20px; }
  .btn[data-oc], .btn[data-params] { flex: 1; min-width: 0; }
  /* Keep the header AND footer on one row like the reference site — brand
     stays left, meta stays right, nothing stacks. */
  .site-name { font-size: 18px; }
  .head-right { font-size: 11px; }
  footer { font-size: 11px; }
}

/* ---------- Two-up layout (same theme — boxes/titles just repositioned) ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; align-items: stretch; }
.grid-2 .gcol { display: flex; flex-direction: column; }
.grid-2 .gcol > .card { flex: 1 1 auto; }   /* About card grows to match Friends card height */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; margin-bottom: 14px; }
.card-grid .card { margin-bottom: 0; }

/* ---------- Oculus main: 2 boxes per row; the 3-field box full-width on its own row ---------- */
.oc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.oc-grid .card { margin-bottom: 0; display: flex; flex-direction: column; }
.oc-grid .oc-last { order: 1; }   /* get/orgscope: flow to the last cell (next to purchase) */
/* When a card is stretched taller than its own content (e.g. purchase, which has
   one fewer field than the get/orgscope box beside it), grow the input section to
   fill and pin the buttons to the bottom so they line up across the row — no blank
   gap under the buttons. */
.oc-grid .card > .card-section:not([id]) { flex: 1 1 auto; display: flex; flex-direction: column; }
.oc-grid .card > .card-section:not([id]) > .actions { margin-top: auto; }
@media (max-width: 760px) { .oc-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .grid-2, .card-grid { grid-template-columns: 1fr; }
  .grid-2 .gcol + .gcol > .section-title { margin-top: 24px; }
}

/* ===================== App shell: sticky left sidebar + wide main =====================
   Breaks out of the centered single column — brand/nav live in a left rail,
   content fills a wide main area to the right. Theme is unchanged. */
.shell { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: start; }
.side { position: sticky; top: 32px; align-self: start; }
.side header { display: block; }                 /* brand stacks in the rail */
.side .head-left { align-items: center; }
.side .dot { margin-top: 0; }   /* center the dot with the stacked brand */
.side .section-title { margin-top: 26px; }
.main { min-width: 0; }                           /* let wide cards shrink properly */
.main > *:first-child { margin-top: 0; }

/* Sidebar section nav (Oculus) */
.toc { display: flex; flex-direction: column; gap: 2px; margin: 26px 0; border-left: 1px solid var(--line); }
.toc a {
  color: var(--muted); text-decoration: none; font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; padding: 8px 14px; margin-left: -1px; border-left: 2px solid transparent;
  transition: color .22s ease, border-color .22s ease, background .22s ease, padding-left .22s ease;
  animation: navIn .5s cubic-bezier(.2,.7,.3,1) backwards;
}
.toc a:nth-child(1) { animation-delay: .06s; }
.toc a:nth-child(2) { animation-delay: .14s; }
.toc a:nth-child(3) { animation-delay: .22s; }
.toc a:hover, .toc a:focus-visible, .toc a.active {
  color: var(--fg); border-left-color: var(--blue); background: rgba(96,165,250,0.06); padding-left: 20px;
}

/* Sidebar meta (version / date) */
.side-meta {
  color: var(--muted); font-size: 12px; line-height: 1.9;
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
}

/* ---------- Home: full-width, stacked sections (about / friends / tools) ---------- */
/* First section header tucks up under the divider instead of the full 26px gap. */
.wrap.home > section:first-of-type .section-head { margin-top: 8px; }
/* Friends fill the whole row; the grid reflows to fewer columns on its own as it
   narrows (no media query needed). Each friend is a 2-line card: name + note. */
.friends-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 0; }
.friend-card {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--card);
  padding: 16px 18px; color: var(--muted); font-size: 13px;
}
.friend-card .friend-name { color: #fff; font-family: var(--mono); font-size: 14px; }
.friend-card .friend-note { color: var(--muted); font-size: 12px; font-family: var(--mono); }
/* Tools card sits right under its section header, spanning the width. */
.home .hub-links { margin-top: 0; }

/* Even home boxes: the about, friend, and tools boxes all share ONE height (the
   about box's), with their content vertically centred. Friend/tools padding is
   trimmed so their two lines fit the shared height without looking cramped. */
.home .card.flat { min-height: 68px; display: flex; }
.home .card.flat .card-section { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.home .friend-card { min-height: 68px; padding: 10px 18px; }
.home .hub-links a { min-height: 68px; padding: 9px 20px; display: flex; flex-direction: column; justify-content: center; }

/* ---------- Oculus shell bits (kept) ---------- */
.main > section:first-child > .section-head { margin-top: 0; }
/* When the sidebar has no nav (home), sit the meta right under the brand */
.side header + .side-meta { margin-top: 18px; padding-top: 0; border-top: 0; }

@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; gap: 26px; }
  .side { position: static; }
}

/* ---------- Animations: sidebar nav entrance + brand dot pulse + smooth scroll ---------- */
html { scroll-behavior: smooth; }
@keyframes navIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 7px rgba(96,165,250,0.85), 0 0 15px rgba(96,165,250,0.5); }
  50%      { box-shadow: 0 0 12px rgba(96,165,250,1), 0 0 26px rgba(96,165,250,0.7), 0 0 40px rgba(96,165,250,0.35); }
}
.side .dot { animation: dotPulse 2.6s ease-in-out infinite; }   /* Oculus sidebar dot only */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toc a, .side .dot { animation: none; }
}

/* ---------- Home: bento mosaic (fills the width, no middle column) ---------- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.b-box { border: 1px solid var(--line); border-radius: 4px; background: var(--card); padding: 20px 22px; transition: transform .18s ease, border-color .18s ease; }
.bento .b-intro { grid-column: 1 / 3; }
.bento .b-api { grid-column: 3; }
.b-intro .brand-row { display: flex; gap: 12px; align-items: center; }
.b-intro .brand-row .dot { margin-top: 0; }
.b-intro .site-name { font-size: 24px; }
.b-intro .about { margin-top: 16px; color: var(--fg); font-size: 13px; line-height: 1.7; max-width: 52ch; }
a.b-api { display: flex; flex-direction: column; justify-content: center; gap: 9px; color: var(--fg); text-decoration: none; }
a.b-api .path { font-size: 15px; color: var(--fg); }
a.b-api .desc { color: var(--muted); font-size: 12px; font-family: var(--sans); line-height: 1.55; }
.b-friend { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.b-friend .friend-name { color: #fff; }
.b-meta { color: var(--muted); font-size: 12px; line-height: 1.9; display: flex; flex-direction: column; justify-content: center; }
a.b-api:hover, .b-friend:hover, .b-meta:hover { transform: translateY(-3px); border-color: var(--line-hi); }
@media (max-width: 760px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .bento .b-intro { grid-column: 1 / 3; }
  .bento .b-api { grid-column: auto; }
}
@media (max-width: 480px) {
  .bento { grid-template-columns: 1fr; }
  .bento .b-intro, .bento .b-api { grid-column: auto; }
}
