/* melody.games shared brand chrome — reset, body baseline, paper-grain,
   site header (brand mark + tagline), home button, footer. Markup is
   rendered by brand/chrome.js (see its header for the data-chrome contract).
   Apps link this AFTER tokens.css and BEFORE their own style.css. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
button { font: inherit; color: inherit; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  min-height: 100dvh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

.paper-grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .45;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(0,0,0,.04) 1px, transparent 2px),
    radial-gradient(circle at 70% 55%, rgba(120,80,30,.03) 1px, transparent 2px),
    radial-gradient(circle at 40% 84%, rgba(0,0,0,.035) 1px, transparent 2px);
  background-size: 220px 220px, 180px 180px, 240px 240px;
  mix-blend-mode: multiply;
}

/* ====== Site header ====== */
.site-header {
  position: relative;
  z-index: 30;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(42,53,84,.10);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.brand-mark { width: 36px; height: 36px; display: block; flex: 0 0 36px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--font-brand);
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: .2px;
}
.brand-tagline {
  font-family: var(--font-cn-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .8px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ====== Site footer ====== */
.site-footer {
  position: relative;
  z-index: 5;
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 20px 16px;
  font-family: var(--font-cn-body);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .6px;
  text-align: center;
  color: var(--muted);
  text-transform: none;
}
.site-footer .dot { opacity: .6; }

/* ====== Mobile: brand block compacts ====== */
@media (max-width: 480px) {
  .site-header { padding: 14px 18px; }
  .brand-mark { width: 30px; height: 30px; flex: 0 0 30px; }
  .brand-name { font-size: 18px; }
}
@media (max-width: 420px) {
  .brand-tagline { display: none; }
}
