/* bread lives at night: one deliberate dark world, matching the bot's
   avatar and banners (dusk plum gradient, white cat, sparkles). */
:root {
  color-scheme: dark;
  --night: #16121c;
  --plum: #221c2a;
  --plum-raised: #2c2436;
  --line: #3a3046;
  --brand: #7f688d;
  --lilac: #cdbfe2;
  --blush: #e4dbee;
  --text: #f4f0f9;
  --muted: #a597b5;
  --ok: #57f287;
  --discord: #313338;
  --discord-embed: #2b2d31;
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--night);
  color: var(--text);
  font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }

/* ---------- top bar: brand, a floating tab bar, and Invite ---------- */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  view-transition-name: site-top;
}
.top.scrolled {
  background: color-mix(in srgb, var(--night) 80%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: color-mix(in srgb, var(--line) 60%, transparent);
}
.top .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-block: 10px; }
.top .wrap > .btn { justify-self: end; }
.brand { justify-self: start; display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.5rem/1 var(--display); }
.brand img { width: 34px; height: 34px; border-radius: 10px; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }

.navtabs {
  position: relative; display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--plum) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.navtabs a {
  position: relative; z-index: 1; padding: 8px 15px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font: 500 .9rem/1.1 var(--body); white-space: nowrap;
  transition: color .2s ease;
}
.navtabs a:hover, .navtabs a[aria-current="page"] { color: var(--text); }
.tab-pill {
  position: absolute; z-index: 0; top: 4px; left: 0; height: calc(100% - 8px); width: 0; border-radius: 999px;
  background: linear-gradient(180deg, #3a3046, var(--plum-raised));
  box-shadow: inset 0 0 0 1px var(--line), 0 6px 18px -8px rgba(127, 104, 141, .8);
  opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.3, 1.25, .45, 1), width .45s cubic-bezier(.3, 1.25, .45, 1), opacity .25s ease;
}
.tab-pill.on { opacity: 1; }
.tab-pill.still { transition: none; }

/* How far down the page you are, as a thin line under the bar. */
.progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--brand), var(--lilac), #e3a6cf);
  opacity: 0; transition: opacity .3s ease;
}
.top.scrolled .progress { opacity: .9; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font: 600 .95rem/1 var(--body); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { position: relative; overflow: hidden; isolation: isolate; background: var(--blush); color: var(--night); box-shadow: 0 8px 24px -10px rgba(228, 219, 238, .55); }
.btn-primary:hover { background: #fff; box-shadow: 0 10px 30px -8px rgba(228, 219, 238, .7); }
/* A sheen that sweeps across on hover (and now and then on .btn-shine). */
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .9) 50%, transparent 70%);
  transform: translateX(-130%);
}
@media (prefers-reduced-motion: no-preference) {
  .btn-primary:hover::after { transform: translateX(130%); transition: transform .75s ease; }
  .btn-shine::after { animation: shine 6s ease-in-out 2.5s infinite; }
}
@keyframes shine { 0%, 72% { transform: translateX(-130%); } 88%, 100% { transform: translateX(130%); } }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--brand); background: var(--plum); }
.btn svg { width: 18px; height: 18px; }


/* ---------- sections ---------- */
section { padding-block: 84px; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.kicker { font: 500 .8rem/1 var(--mono); color: var(--lilac); letter-spacing: .06em; text-transform: uppercase; }
h2 { font: 700 clamp(2rem, 4.6vw, 2.9rem)/1.05 var(--display); margin: 12px 0 12px; text-wrap: balance; }
.section-head p { color: var(--muted); margin: 0; font-size: 1.05rem; }

/* ---------- footer ---------- */
footer {
  position: relative; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem;
  background: radial-gradient(800px 260px at 50% 0%, rgba(127, 104, 141, .14), transparent 70%);
}
.foot-main { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; padding-block: 52px 36px; }
.foot-brand .brand { color: var(--text); }
.foot-brand p { margin: 14px 0 20px; max-width: 34ch; }
.foot-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.foot-links h4 { margin: 0 0 12px; font: 600 .74rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #8f82a0; }
.foot-links a { display: block; width: fit-content; padding: 5px 0; color: var(--muted); text-decoration: none; transition: color .15s ease, transform .2s ease; }
.foot-links a:hover { color: var(--text); transform: translateX(3px); }
.foot-base { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; padding-block: 18px 26px; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
footer .made { display: inline-flex; align-items: center; gap: 8px; }
footer .made img { width: 20px; height: 20px; }
footer .made b { color: var(--text); font-weight: 600; }

/* ---------- back to top ---------- */
.to-top {
  position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--plum-raised) 88%, transparent); color: var(--text);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .7);
  opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
  transition: opacity .25s ease, transform .3s cubic-bezier(.3, 1.4, .5, 1), border-color .2s ease;
}
.to-top svg { width: 20px; height: 20px; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--brand); }
.to-top:hover svg { animation: nudge .6s ease; }
@keyframes nudge { 40% { transform: translateY(-4px); } }

/* ---------- motion: things rise in on load and fade in on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .page-head .wrap > *, .cmd-hero .wrap > *:not(.stats), .hero .wrap > div:first-child > *, .hero .discord {
    animation: rise .8s cubic-bezier(.2, .8, .2, 1) both;
  }
  .page-head .wrap > :nth-child(2), .cmd-hero .wrap > :nth-child(2), .hero .wrap > div:first-child > :nth-child(2) { animation-delay: .08s; }
  .page-head .wrap > :nth-child(3), .cmd-hero .wrap > :nth-child(3), .hero .wrap > div:first-child > :nth-child(3) { animation-delay: .16s; }
  .hero .wrap > div:first-child > :nth-child(4) { animation-delay: .24s; }
  .hero .wrap > div:first-child > :nth-child(5) { animation-delay: .32s; }
  .hero .discord { animation-delay: .2s; animation-duration: 1s; }
  .rv { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--rv-delay, 0s); }
  .rv.rv-in { opacity: 1; transform: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- a glow that follows the pointer over cards ---------- */
.spot { position: relative; }
.spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), rgba(205, 191, 226, .1), transparent 65%);
  transition: opacity .3s ease;
}
.spot:hover::after { opacity: 1; }

/* ---------- page to page: a soft cross-fade, with the top bar holding still ---------- */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-out .2s ease both; }
  ::view-transition-new(root) { animation: vt-in .38s cubic-bezier(.2, .8, .3, 1) both; }
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- sub-page header ---------- */
.page-head {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(700px 360px at 50% -40%, rgba(143, 122, 160, .45), transparent 70%),
    linear-gradient(180deg, #2a2233 0%, var(--night) 100%);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.page-head .wrap { padding-block: 64px 56px; }
.page-head h1 { font: 800 clamp(2.6rem, 7vw, 4.4rem)/1 var(--display); margin: 12px 0 12px; letter-spacing: -.01em; text-wrap: balance; }
.page-head h1 span { color: var(--lilac); }
.page-head p { color: var(--muted); font-size: 1.1rem; margin: 0 auto; max-width: 52ch; }

/* ---------- the light-ribbon sky behind page heroes (sky.js) ---------- */
/* It fades in over the CSS background once WebGL has drawn a frame. */
.sky {
  position: absolute; inset: -62px 0 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.2s ease;
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent); mask-image: linear-gradient(180deg, #000 78%, transparent);
}
/* Overlay skies add their light to the background under them. */
.sky[data-sky="overlay"] { mix-blend-mode: screen; }
.hero .sky { inset: 0; -webkit-mask-image: none; mask-image: none; }
.page-head .sky { inset: 0; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.sky.sky-on { opacity: 1; }
.sky canvas { display: block; width: 100% !important; height: 100% !important; }

/* ---------- panels (status + embed pages) ---------- */
.panel { background: var(--plum); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; }
.panel-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { font: 700 1.25rem/1.2 var(--display); margin: 0; }
.panel-head .icon {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--plum-raised); border: 1px solid var(--line);
}
.panel-head .icon img { width: 22px; height: 22px; }
.panel-head .actions { margin-left: auto; display: flex; gap: 6px; }
.panel-body { padding: 18px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--plum-raised); border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--blush); color: var(--night); font-weight: 600; font-size: .92rem;
  padding: 10px 16px; border-radius: 999px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .foot-main { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-block: 40px 28px; }
}
@media (max-width: 680px) {
  .top .wrap { gap: 8px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .navtabs { justify-self: center; }
  .brand span { display: none; }
  .navtabs a { padding: 8px 11px; font-size: .86rem; }
  .navtabs .tab-home { display: none; }
  .top .wrap > .btn { padding: 9px 14px; font-size: .86rem; }
}
@media (max-width: 600px) {
  section { padding-block: 60px; }
}
@media (max-width: 420px) {
  .top .wrap { padding-inline: 14px; }
  .navtabs { padding: 3px; }
  .navtabs a { padding: 8px 9px; font-size: .82rem; }
  .tab-pill { top: 3px; height: calc(100% - 6px); }
  .top .wrap > .btn { padding: 8px 12px; font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .toast, .tab-pill, .to-top { transition: none; }
  .btn:hover { transform: none; }
}

/* ---------- no copying ----------
   Page text can't be selected, copied, dragged or right-clicked. Form fields
   and outputs meant to be copied (.allow-copy) still work normally. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], .allow-copy { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img, svg, a { -webkit-user-drag: none; }
