/* Melodreams Help — minimal house style.
   Layout pattern matches other public pages: max-width chrome, dark
   backdrop with subtle accent, Onest from the shared font CDN. No
   Tailwind — every utility we need is small enough to keep inline. */

:root {
  --bg: #06060c;
  --bg-elev: rgba(255, 255, 255, 0.03);
  --bg-elev-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-mute: rgba(255, 255, 255, 0.62);
  --text-faint: rgba(255, 255, 255, 0.42);
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Onest', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Nav ────────────────────────────────────────────────────────── */
.h-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 6, 12, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.h-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.h-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none !important;
  font-weight: 600;
}
.h-brand:hover {
  text-decoration: none !important;
  opacity: 0.85;
}
.h-brand img { width: 28px; height: 28px; border-radius: 8px; }
.h-brand-name { font-size: 1.02rem; letter-spacing: -0.01em; }
.h-brand-tag {
  font-size: 0.78rem;
  color: var(--text-faint);
  padding-left: 10px;
  margin-left: 4px;
  border-left: 1px solid var(--border);
}
.h-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
}
.h-cta:hover { background: rgba(255, 255, 255, 0.12); text-decoration: none; }

/* ── Hero (compact, not loud) ──────────────────────────────────── */
.h-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 20px 28px;
  text-align: left;
}
.h-hero h1 {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.h-hero p {
  color: var(--text-mute);
  font-size: 1rem;
  margin: 0 0 20px;
}

/* ── Search ─────────────────────────────────────────────────────── */
.h-search {
  position: relative;
}
.h-search input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 14px 44px;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.h-search input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(255, 255, 255, 0.05);
}
.h-search input::placeholder { color: var(--text-faint); }
.h-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
  font-size: 0.95rem;
}
/* Search results dropdown. Forced left-align so it doesn't inherit
   the centered text-align from the home hero (which left a column
   of centered titles, looked broken). Tighter shadow + smaller
   padding for less visual weight. */
.h-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #0a0a12;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
  text-align: left !important;
}
.h-search-results[hidden] { display: none; }
.h-search-result {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  text-align: left;
}
.h-search-result:hover {
  background: var(--bg-elev-hover);
  text-decoration: none;
}
.h-search-result-title {
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
}
.h-search-result-cat {
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-top: 2px;
  text-align: left;
}
.h-search-empty {
  padding: 14px;
  color: var(--text-faint);
  font-size: 0.86rem;
  text-align: center;
}

/* ── Categories grid ───────────────────────────────────────────── */
.h-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}
.h-cat {
  margin: 36px 0 0;
}
.h-cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.h-cat-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.86rem;
}
.h-cat-title {
  font-size: 1.04rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
}
.h-cat-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.h-article-link {
  display: block;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.h-article-link:hover {
  background: var(--bg-elev-hover);
  border-color: rgba(255, 255, 255, 0.16);
  text-decoration: none;
}
.h-article-link-title {
  font-size: 0.92rem;
  font-weight: 500;
  margin: 0;
}
.h-article-link-sub {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 4px;
}

/* ── Article page layout ───────────────────────────────────────── */
.h-article {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.h-article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-mute);
  font-size: 0.86rem;
  text-decoration: none;
  margin-bottom: 24px;
}
.h-article-back:hover {
  color: var(--text);
  text-decoration: none;
}
.h-article-cat {
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}
.h-article-title {
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
  line-height: 1.2;
}
.h-article-body {
  font-size: 0.98rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.86);
}
.h-article-body h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 36px 0 10px;
  letter-spacing: -0.005em;
}
.h-article-body h3 {
  font-size: 0.96rem;
  font-weight: 600;
  margin: 26px 0 8px;
}
.h-article-body p { margin: 0 0 14px; }
.h-article-body ul, .h-article-body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}
.h-article-body li { margin-bottom: 6px; }
.h-article-body code {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.86em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.h-article-body blockquote {
  border-left: 2px solid var(--accent);
  margin: 14px 0;
  padding: 4px 0 4px 14px;
  color: var(--text-mute);
}
.h-article-related {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.h-article-related h3 {
  font-size: 0.82rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}
.h-related-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.h-related-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
}
.h-related-list a:hover {
  background: var(--bg-elev-hover);
  text-decoration: none;
}

/* ── Still stuck card ──────────────────────────────────────────── */
.h-still-stuck {
  margin-top: 56px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.h-still-stuck-head {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
}
.h-still-stuck-sub {
  font-size: 0.88rem;
  color: var(--text-mute);
  margin: 0 0 14px;
}
.h-still-stuck-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.h-still-stuck-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.86rem;
  text-decoration: none;
  font-weight: 500;
}
.h-still-stuck-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

/* ── Home page — search-first, single-focus layout ─────────────── */
/* Body is plain block flow so the platform footer (injected by
   add_footer.js after page load) appears naturally at the end. The
   centering used to live on body via flex which pushed the footer
   off the page on tall viewports. Now `.h-home-main` carries a
   min-height calc so the hero still feels centred without breaking
   document flow. */
.h-home-main {
  min-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 40px;
  text-align: center;
}
.h-home-hero {
  width: 100%;
  max-width: 640px;
}
.h-home-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin: 0 auto 18px;
  display: block;
}
.h-home-title {
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.h-home-sub {
  font-size: 0.96rem;
  color: var(--text-mute);
  margin: 0 0 28px;
}
.h-search--big input {
  padding: 18px 20px 18px 52px;
  font-size: 1.02rem;
  border-radius: 16px;
  padding-right: 70px;
}
.h-search--big .h-search-icon {
  left: 20px;
  font-size: 1.08rem;
}
.h-search-kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  pointer-events: none;
  letter-spacing: 0.02em;
}
.h-search--big:focus-within .h-search-kbd { display: none; }

.h-home-popular {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
}
.h-home-pop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.84rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.h-home-pop i {
  color: var(--text-faint);
  font-size: 0.86rem;
}
.h-home-pop:hover {
  background: var(--bg-elev-hover);
  border-color: rgba(255, 255, 255, 0.18);
  text-decoration: none;
  transform: translateY(-1px);
}
.h-home-browse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  color: var(--text-mute);
  font-size: 0.86rem;
  text-decoration: none;
}
.h-home-browse:hover { color: var(--text); text-decoration: none; }
.h-home-browse i {
  font-size: 0.74rem;
  transition: transform 0.15s ease;
}
.h-home-browse:hover i { transform: translateX(2px); }

.h-home-stuck {
  text-align: center;
  padding: 18px 20px 36px;
  color: var(--text-faint);
  font-size: 0.84rem;
}
.h-home-stuck a { color: var(--accent); }

/* ── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .h-hero { padding: 40px 16px 20px; }
  .h-hero h1 { font-size: 1.5rem; }
  .h-content { padding: 20px 16px 60px; }
  .h-article { padding: 28px 16px 60px; }
  .h-article-title { font-size: 1.45rem; }
  .h-cat-list { grid-template-columns: 1fr; }
  .h-brand-tag { display: none; }
  .h-nav-inner { padding: 12px 16px; }

  /* Home: tighter padding, smaller logo, 2-column popular row, hide
     Cmd-K hint (no physical keyboard, no point). */
  .h-home-main { padding: 40px 16px 24px; min-height: calc(100vh - 160px); }
  .h-home-logo { width: 48px; height: 48px; margin-bottom: 14px; }
  .h-home-title { font-size: 1.65rem; }
  .h-home-sub { font-size: 0.88rem; margin-bottom: 20px; }
  .h-search--big input { padding: 14px 16px 14px 44px; font-size: 0.95rem; }
  .h-search--big .h-search-icon { left: 16px; }
  .h-search-kbd { display: none; }
  .h-home-popular {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 18px;
  }
  .h-home-pop { font-size: 0.78rem; padding: 10px 8px; }
}
