/* Scroll-world home page — "El Grito Gold" theme over the vendored scrub engine.
   The engine injects its own CSS inside `@layer sw`, so every unlayered rule here wins
   by design (see the THEME + cascade-layer notes in js/scroll-world/scrub-engine.js).
   Brand tokens per website/CLAUDE.md; do not introduce colors outside that table. */

/* ---- theme tokens on the mount container ------------------------------------------ */

#world.sw-root,
#world {
  --sw-bg: #15110C;             /* Obsidian */
  --sw-ink: #F4ECDC;            /* Bone White */
  --sw-ink-soft: #B7AB92;       /* muted bone (solid — reliable inside color-mix) */
  --sw-accent: #C8A24B;         /* Eagle Gold default; each section overrides in-flight */
  --sw-font-display: 'Archivo Black', system-ui, sans-serif;
  --sw-font-body: 'Inter', system-ui, sans-serif;
}

body.sw-page {
  margin: 0;
  background: #15110C;
  color: #F4ECDC;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ---- dark re-skin of the engine chrome (its defaults assume a light page) --------- */

/* Archivo Black ships one weight; stop the browser faux-bolding it. */
#world .sw-copy__title,
#world .sw-copy__eyebrow,
#world .sw-brand__name {
  font-weight: 400;
  font-synthesis: none;
}

#world .sw-sky__glow {
  background:
    radial-gradient(60% 42% at 74% 16%, color-mix(in srgb, var(--sw-accent) 20%, transparent), transparent 70%),
    radial-gradient(46% 34% at 50% 55%, color-mix(in srgb, var(--sw-accent) 8%, transparent), transparent 70%);
}

#world .sw-nav {
  background: rgba(21, 17, 12, 0.55);
  border-color: color-mix(in srgb, var(--sw-accent) 26%, transparent);
}
#world .sw-nav__item.is-active { color: #15110C; }

#world .sw-topcta {
  color: #15110C;
  background: var(--sw-accent);
}

#world .sw-btn--primary {
  color: #15110C;
  background: var(--sw-accent);
}
#world .sw-btn--ghost {
  color: var(--sw-ink);
  border-color: color-mix(in srgb, var(--sw-ink) 35%, transparent);
}

#world .sw-copy__tags li {
  color: color-mix(in srgb, var(--sw-accent) 78%, #fff);
  background: color-mix(in srgb, var(--sw-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--sw-accent) 34%, transparent);
}

#world .sw-route__label {
  color: var(--sw-ink);
  background: rgba(21, 17, 12, 0.85);
}

#world a:focus-visible,
#world button:focus-visible {
  outline: 2px solid var(--sw-accent);
  outline-offset: 2px;
}

/* ---- regional hub panels (server-rendered fragments, attached after mount) -------- */

.sw-hub {
  margin-top: 22px;
  pointer-events: auto;           /* panel visibility gating is the engine's job */
}

.sw-hub__head {
  margin: 0 0 8px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sw-ink-soft);
}

.sw-hub__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 36vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--sw-accent) 45%, transparent) transparent;
  padding-right: 4px;
}

.sw-hub__card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-decoration: none;
  color: var(--sw-ink);
  padding: 7px;
  border-radius: 9px;
  background: rgba(21, 17, 12, 0.55);
  border: 1px solid color-mix(in srgb, var(--sw-accent) 16%, transparent);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, background 0.2s;
}
.sw-hub__card:hover {
  border-color: color-mix(in srgb, var(--sw-accent) 55%, transparent);
  background: rgba(28, 23, 16, 0.72);
}

.sw-hub__thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: #1c1710;
}

.sw-hub__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sw-hub__title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sw-hub__hook {
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--sw-ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Confidence tally chips — same semantics as the site cards: gold Solid,
   terracotta Contested, jade Myth-corrected. */
.sw-hub__conf { display: flex; gap: 5px; margin-top: 2px; }
.sw-hub__conf i {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
}
.sw-hub__conf .s { color: #C8A24B; background: rgba(200, 162, 75, 0.16); }
.sw-hub__conf .c { color: #d98b66; background: rgba(181, 81, 46, 0.20); }
.sw-hub__conf .m { color: #4fc3c2; background: rgba(14, 140, 139, 0.18); }

.sw-hub__more {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sw-accent);
  text-decoration: none;
}
.sw-hub__more:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .sw-hub { margin-top: 14px; }
  .sw-hub__list { max-height: 24vh; }
  .sw-hub__thumb { width: 72px; height: 40px; }
  .sw-hub__hook { display: none; }   /* keep the bottom-anchored panel short on phones */
}

/* ---- SEO mirror (visible only before mount / without JS) -------------------------- */

.sw-seo {
  max-width: 72ch;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px) clamp(18px, 5vw, 40px) 80px;
  line-height: 1.6;
}
.sw-seo a { color: #C8A24B; }
.sw-seo a:hover { color: #E0B84C; }

.sw-seo__kicker {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0E8C8B;
}
.sw-seo h1 {
  font-family: 'Archivo Black', system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  line-height: 1.1;
  margin: 12px 0 16px;
}
.sw-seo h2 {
  font-family: 'Archivo Black', system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  margin: 40px 0 8px;
  color: #F4ECDC;
}
.sw-seo__tags { color: #B7AB92; font-size: 0.85rem; }
.sw-seo ul { padding-left: 1.2em; }
.sw-seo li { margin: 6px 0; }
.sw-seo__foot {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid rgba(200, 162, 75, 0.22);
  color: #B7AB92;
  font-size: 0.85rem;
}
