/* Beacon Lattice — help-only identity
   Sticky radar + scroll river + spotlight Q&A.
   Independent of Field Guide / Support Codex / Iris / Volt / Quarry. */

body.hx-beacon *,
body.hx-beacon *::before,
body.hx-beacon *::after {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.hx-root {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.hx-root > .page-main {
  flex: 1;
  width: 100%;
  padding: 0;
  overflow: visible;
}

body.hx-beacon {
  --hx-paper: #F3F5F7;
  --hx-ink: #10151C;
  --hx-mute: #3d4654;
  --hx-signal: #FF6B35;
  --hx-beam: #1F8A7A;
  --hx-void: #161B22;
  --hx-line: rgba(16, 21, 28, 0.12);
  --hx-white: #FFFFFF;
  --hx-display: 'Teko', system-ui, sans-serif;
  --hx-body: 'Mulish', system-ui, sans-serif;
  --hx-ease: cubic-bezier(0.22, 1, 0.36, 1);

  margin: 0;
  min-height: 100vh;
  font-family: var(--hx-body);
  color: var(--hx-ink);
  background:
    radial-gradient(100% 60% at 0% 0%, rgba(31, 138, 122, 0.12), transparent 50%),
    radial-gradient(80% 50% at 100% 8%, rgba(255, 107, 53, 0.1), transparent 45%),
    linear-gradient(180deg, #E8EDF2 0%, var(--hx-paper) 28%, #EEF1F4 100%);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body.hx-beacon .a63-fold-wrap,
body.hx-beacon .a63-ribbon,
body.hx-beacon .a63-mast,
body.hx-beacon .a63-colophon {
  display: none !important;
}

body.hx-beacon .page-main {
  padding: 0;
  max-width: none;
  overflow: visible;
}

.hx-shell {
  position: relative;
  padding: 0 0 2.5rem;
}

/* Scroll progress */

.hx-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 90;
  background: rgba(16, 21, 28, 0.08);
}

.hx-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--hx-beam), var(--hx-signal));
  transition: width 0.1s linear;
}

/* Top */

.hx-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.1rem clamp(1rem, 3vw, 1.75rem) 0;
}

.hx-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--hx-ink);
}

.hx-brand em {
  font-style: normal;
  font-family: var(--hx-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--hx-ink);
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  background: var(--hx-white);
}

.hx-brand span {
  font-family: var(--hx-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hx-brand:hover { color: var(--hx-beam); text-decoration: none; }

.hx-top-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hx-mute);
}

.hx-top-meta a {
  color: var(--hx-signal);
  text-decoration: none;
}

.hx-top-meta a:hover { text-decoration: underline; }

/* Hero */

.hx-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1rem, 3vw, 1.75rem) 1.5rem;
}

.hx-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hx-beam);
}

.hx-hero h1 {
  margin: 0;
  display: flex;
  flex-direction: column;
  line-height: 0.85;
}

.hx-fluid {
  font-family: var(--hx-display);
  font-weight: 600;
  font-size: clamp(3.25rem, 14vw, 9.5rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  background: linear-gradient(105deg, var(--hx-ink) 30%, var(--hx-beam) 70%, var(--hx-signal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform-origin: left center;
  will-change: transform;
}

.hx-fluid-alt {
  background: linear-gradient(105deg, var(--hx-signal) 10%, var(--hx-ink) 55%);
  -webkit-background-clip: text;
  background-clip: text;
  margin-left: clamp(1rem, 6vw, 4rem);
}

.hx-lede {
  margin: 1.1rem 0 0;
  max-width: 38rem;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--hx-mute);
}

/* Command search */

.hx-command {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  max-width: 640px;
  padding: 0.45rem 0.45rem 0.45rem 0.9rem;
  background: var(--hx-white);
  border: 1px solid var(--hx-line);
  box-shadow: 0 18px 40px rgba(16, 21, 28, 0.06);
  transition: border-color 0.3s ease, box-shadow 0.35s var(--hx-ease);
}

.hx-command:focus-within {
  border-color: var(--hx-beam);
  box-shadow: 0 18px 40px rgba(31, 138, 122, 0.15);
}

.hx-command-prefix {
  font-family: var(--hx-display);
  font-size: 1.6rem;
  color: var(--hx-signal);
  line-height: 1;
}

.hx-command input {
  border: 0;
  outline: none;
  font: inherit;
  font-size: 1.05rem;
  color: var(--hx-ink);
  background: transparent;
  min-width: 0;
  padding: 0.55rem 0;
  width: 100%;
}

.hx-command input::placeholder {
  color: #5c6678;
}

.hx-kbd {
  font-family: var(--hx-body);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--hx-line);
  color: var(--hx-mute);
  background: var(--hx-paper);
}

.hx-command button {
  border: 0;
  background: var(--hx-void);
  color: var(--hx-white);
  font-family: var(--hx-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.3s var(--hx-ease);
}

.hx-command button:hover {
  background: var(--hx-signal);
  transform: translateY(-1px);
}

.hx-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.hx-chip {
  border: 1px solid var(--hx-line);
  background: var(--hx-white);
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--hx-mute);
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.35s var(--hx-ease);
}

@media (prefers-reduced-motion: no-preference) {
  .hx-chip {
    animation: hx-rise 0.5s var(--hx-ease) both;
    animation-delay: calc(var(--si, 0) * 0.04s);
  }
}

.hx-chip:hover {
  background: var(--hx-ink);
  color: var(--hx-white);
  border-color: var(--hx-ink);
  transform: translateY(-2px);
}

@keyframes hx-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Layout: sticky radar + river */

.hx-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0.5rem auto 0;
  padding: 0 clamp(1rem, 3vw, 1.75rem);
  align-items: start;
}

.hx-radar {
  position: sticky;
  top: 1.25rem;
  padding: 1rem 0.85rem 1.25rem;
  background: var(--hx-void);
  color: var(--hx-white);
  clip-path: polygon(0 0, 100% 0, 100% 92%, 50% 100%, 0 92%);
  min-height: 280px;
  z-index: 5;
}

.hx-radar-label {
  margin: 0 0 0.85rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hx-radar-ring {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hx-radar-node {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  transition:
    color 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.35s var(--hx-ease);
}

.hx-radar-node strong {
  font-family: var(--hx-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  color: var(--hx-signal);
}

.hx-radar-node span {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hx-radar-node:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  transform: translateX(4px);
}

.hx-radar-node.is-active {
  color: #fff;
  background: rgba(255, 107, 53, 0.18);
  border-color: rgba(255, 107, 53, 0.45);
}

.hx-radar-pulse {
  margin-top: 1.25rem;
  width: 3.5rem;
  height: 3.5rem;
  margin-inline: auto;
  border-radius: 50%;
  border: 2px solid rgba(255, 107, 53, 0.45);
  position: relative;
}

.hx-radar-pulse::before,
.hx-radar-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(31, 138, 122, 0.5);
  animation: hx-ping 2.4s var(--hx-ease) infinite;
}

.hx-radar-pulse::after {
  animation-delay: 0.8s;
}

@keyframes hx-ping {
  0% { transform: scale(0.55); opacity: 0.9; }
  100% { transform: scale(1.65); opacity: 0; }
}

/* River / chapters */

.hx-river {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-margin-top: 1rem;
}

.hx-chapter {
  scroll-margin-top: 1.25rem;
  background: var(--hx-white);
  border: 1px solid var(--hx-line);
  padding: 0;
  overflow: hidden;
  /* Visible by default — inview is an enhancement, not a gate */
  opacity: 1;
  transform: none;
  filter: none;
  box-shadow: 0 10px 28px rgba(16, 21, 28, 0.04);
  transition:
    box-shadow 0.45s var(--hx-ease),
    border-color 0.35s ease;
}

.hx-chapter.is-inview {
  box-shadow: 0 22px 48px rgba(16, 21, 28, 0.08);
  border-color: rgba(31, 138, 122, 0.28);
}

.hx-chapter-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding: 1.25rem 1.35rem 1rem;
  border-bottom: 1px solid var(--hx-line);
  background:
    linear-gradient(120deg, rgba(31, 138, 122, 0.08), transparent 55%);
}

.hx-chapter-index {
  margin: 0 0 0.2rem;
  font-family: var(--hx-display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hx-beam);
}

.hx-chapter-head h2 {
  margin: 0;
  font-family: var(--hx-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}

.hx-chapter-blurb {
  margin: 0.35rem 0 0;
  color: var(--hx-mute);
  font-size: 0.95rem;
}

.hx-chapter-count {
  font-family: var(--hx-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--hx-signal);
  white-space: nowrap;
}

/* Spotlight: question rail + answer stage */

.hx-spotlight {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(240px, 1.15fr);
  min-height: 280px;
}

.hx-q-rail {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--hx-line);
  max-height: 420px;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--hx-beam) transparent;
}

.hx-q-rail::-webkit-scrollbar {
  width: 6px;
}

.hx-q-rail::-webkit-scrollbar-thumb {
  background: var(--hx-beam);
  border-radius: 99px;
}

.hx-q {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  padding: 0.95rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--hx-line);
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: var(--hx-ink);
  transition: background 0.25s ease, color 0.25s ease;
}

.hx-q:hover {
  background: rgba(31, 138, 122, 0.06);
}

.hx-q.is-active {
  background: var(--hx-void);
  color: var(--hx-white);
}

.hx-q.is-active .hx-q-num {
  color: var(--hx-signal);
}

.hx-q.is-filtered-out {
  display: none;
}

.hx-q-num {
  font-family: var(--hx-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--hx-beam);
  line-height: 1;
}

.hx-q-text {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.35;
}

.hx-q-chev {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.45;
  transition: transform 0.35s var(--hx-ease), opacity 0.25s ease;
}

.hx-q.is-active .hx-q-chev {
  opacity: 1;
  transform: rotate(45deg);
}

.hx-a-stage {
  position: relative;
  padding: 1.35rem 1.4rem 1.5rem;
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(255, 107, 53, 0.1), transparent 55%),
    var(--hx-paper);
}

.hx-a {
  display: none;
}

.hx-a[hidden] {
  display: none !important;
}

.hx-a.is-active:not([hidden]) {
  display: block;
  animation: hx-rise 0.4s var(--hx-ease);
}

@media (prefers-reduced-motion: reduce) {
  .hx-a.is-active:not([hidden]) {
    animation: none;
  }
}

.hx-a-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hx-signal);
}

.hx-a h3 {
  margin: 0 0 0.75rem;
  font-family: var(--hx-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.05;
}

.hx-a-body {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #3D4754;
}

.hx-a-body a {
  color: var(--hx-beam);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hx-a-body a:hover {
  color: var(--hx-signal);
}

.hx-empty {
  padding: 1.25rem;
  background: var(--hx-white);
  border: 1px dashed var(--hx-signal);
  color: var(--hx-mute);
}

.hx-empty a { color: var(--hx-signal); font-weight: 700; }

.hx-chapter.is-filtered-out {
  display: none;
}

/* Bridges */

.hx-bridges {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding: 0 clamp(1rem, 3vw, 1.75rem);
}

.hx-bridges-head h2 {
  margin: 0;
  font-family: var(--hx-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
}

.hx-bridge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.hx-bridge {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.2rem 1.1rem 1.3rem;
  background: var(--hx-white);
  border: 1px solid var(--hx-line);
  text-decoration: none;
  color: var(--hx-ink);
  overflow: hidden;
  transition:
    transform 0.4s var(--hx-ease),
    background 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .hx-bridge {
    animation: hx-rise 0.5s var(--hx-ease) both;
    animation-delay: calc(var(--bi, 0) * 0.06s);
  }
}

.hx-bridge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--hx-void), #243040);
  transform: translateY(102%);
  transition: transform 0.45s var(--hx-ease);
  z-index: 0;
}

.hx-bridge > * {
  position: relative;
  z-index: 1;
}

.hx-bridge:hover {
  color: var(--hx-white);
  border-color: transparent;
  transform: translateY(-5px) skewY(-0.5deg);
  text-decoration: none;
}

.hx-bridge:hover::before {
  transform: translateY(0);
}

.hx-bridge-hint {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hx-beam);
}

.hx-bridge:hover .hx-bridge-hint {
  color: var(--hx-signal);
}

.hx-bridge strong {
  font-family: var(--hx-display);
  font-size: 1.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
}

.hx-bridge em {
  font-style: normal;
  align-self: flex-end;
  opacity: 0.5;
  transition: transform 0.35s var(--hx-ease), opacity 0.25s ease;
}

.hx-bridge:hover em {
  opacity: 1;
  transform: translate(3px, -3px);
}

/* Desk */

.hx-desk {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 0 clamp(1rem, 3vw, 1.75rem);
}

.hx-desk-card {
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--hx-void);
  color: var(--hx-white);
  clip-path: polygon(0 0, 100% 0, 100% 78%, 96% 100%, 0 100%);
}

.hx-desk-card .hx-eyebrow {
  color: var(--hx-signal);
}

.hx-desk-card h2 {
  margin: 0 0 0.5rem;
  font-family: var(--hx-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
}

.hx-desk-card > p {
  margin: 0 0 1.25rem;
  color: rgba(255, 255, 255, 0.82);
}

.hx-desk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.2rem;
  background: var(--hx-signal);
  color: var(--hx-white);
  font-family: var(--hx-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.3s var(--hx-ease), background 0.25s ease;
}

.hx-btn:hover {
  background: var(--hx-beam);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}

.hx-btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.hx-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #fff;
}

/* Foot */

.hx-foot {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 3vw, 1.75rem) 1.75rem;
  border-top: 1px solid var(--hx-line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hx-mute);
}

.hx-foot a {
  color: var(--hx-ink);
  text-decoration: none;
}

.hx-foot a:hover { color: var(--hx-signal); }

@media (max-width: 960px) {
  .hx-layout {
    grid-template-columns: 1fr;
  }

  .hx-radar {
    position: relative;
    top: 0;
    clip-path: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    min-height: 0;
    padding: 0.85rem 1rem;
  }

  .hx-radar-label {
    margin: 0;
  }

  .hx-radar-ring {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
    padding-bottom: 0.15rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .hx-radar-node {
    flex: 0 0 auto;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.06);
  }

  .hx-radar-pulse {
    display: none;
  }

  .hx-spotlight {
    grid-template-columns: 1fr;
  }

  .hx-q-rail {
    max-height: min(280px, 45vh);
    border-right: 0;
    border-bottom: 1px solid var(--hx-line);
  }

  .hx-a-stage {
    padding: 1.15rem 1.1rem 1.35rem;
  }

  .hx-bridge-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .hx-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .hx-top-meta {
    gap: 0.45rem 0.85rem;
  }

  .hx-top-meta span:nth-child(2) {
    display: none;
  }

  .hx-command {
    grid-template-columns: auto 1fr auto;
  }

  .hx-kbd {
    display: none;
  }

  .hx-bridge-grid {
    grid-template-columns: 1fr;
  }

  .hx-radar-label {
    display: none;
  }

  .hx-desk-card {
    clip-path: none;
  }

  .hx-chapter-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.hx-beacon {
    scroll-behavior: auto;
  }

  .hx-radar-pulse::before,
  .hx-radar-pulse::after,
  .hx-chip,
  .hx-bridge,
  .hx-a.is-active:not([hidden]) {
    animation: none !important;
  }

  .hx-fluid {
    will-change: auto;
  }
}
