/* Harness home pages (ai/<harness>/index.html): roadmap poster + architecture matrix.
   Material-style light theme. Each page sets --hx-accent on .hx-page. */

body.hx-body { background: #f4f6f8; color-scheme: light; }

.hx-page {
  --hx-accent: #7c3aed;
  --hx-bg: #f4f6f8;
  --hx-paper: #ffffff;
  --hx-divider: #e5e7eb;
  --hx-text: rgba(0, 0, 0, 0.87);
  --hx-text-2: rgba(0, 0, 0, 0.6);
  --hx-chip: #f5f5f5;
  --hx-elev-1: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --hx-elev-2: 0 3px 6px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
  --hx-elev-4: 0 10px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  color: var(--hx-text);
}
.hx-page, .hx-page h1, .hx-page h2, .hx-page h3, .hx-page h4, .hx-page button {
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif !important;
}
.hx-page *, .hx-page *::before, .hx-page *::after { box-sizing: border-box; }
.hx-page h1, .hx-page h2, .hx-page h3, .hx-page h4, .hx-page p, .hx-page ul { margin: 0; }
.hx-logo { width: 22px; height: 22px; object-fit: contain; flex: none; }

.hx-paper { background: var(--hx-paper); border-radius: 12px; box-shadow: var(--hx-elev-1); }
.hx-overline { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hx-text-2); }

/* ---------- Poster header ---------- */
.hx-poster { padding: 24px; margin-bottom: 32px; }
.hx-poster-head {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 28px; margin-bottom: 28px; border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--hx-accent) 8%, #ffffff), #ffffff 70%);
  border: 1px solid var(--hx-divider);
}
.hx-poster-title { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 900; letter-spacing: -0.01em; line-height: 1.15; margin: 6px 0 10px !important; color: #111827; }
.hx-pill {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: #fff; background: var(--hx-accent); padding: 5px 12px; border-radius: 4px;
}
.hx-lede { margin-top: 14px !important; max-width: 760px; font-size: 0.98rem; line-height: 1.6; color: var(--hx-text-2); }
.hx-head-art { display: flex; align-items: center; gap: 16px; flex: none; }
.hx-head-logo {
  width: 96px; height: 96px; border-radius: 24px; background: #fff; display: grid; place-items: center;
  box-shadow: var(--hx-elev-2); border: 2px solid color-mix(in srgb, var(--hx-accent) 35%, #fff);
}
.hx-head-logo img { width: 56px; height: 56px; }
.hx-head-tiles { display: grid; grid-template-columns: repeat(3, 44px); gap: 8px; }
.hx-head-tiles span { width: 44px; height: 44px; border-radius: 10px; background: #fff; box-shadow: var(--hx-elev-1); display: grid; place-items: center; }
.hx-head-tiles img { width: 24px; height: 24px; }

/* ---------- Poster body: spine + sidebars ---------- */
.hx-poster-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.hx-spine { position: relative; display: flex; flex-direction: column; gap: 16px; }
.hx-spine::before { content: ""; position: absolute; top: 24px; bottom: 24px; left: 21px; border-left: 2px dashed #cbd5e1; }

.hx-step { position: relative; display: flex; gap: 14px; align-items: stretch; }
.hx-step-nodes { display: flex; align-items: center; gap: 10px; flex: none; align-self: center; z-index: 1; }
.hx-step-num {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--node); color: #fff; font-weight: 900; font-size: 1rem;
  box-shadow: 0 0 0 4px #fff, var(--hx-elev-2);
}
.hx-step-icon {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--node); border: 2px solid var(--node); box-shadow: var(--hx-elev-1);
}
.hx-step-icon svg { width: 19px; height: 19px; }
.hx-step-card {
  flex: 1; min-width: 0; display: flex; gap: 18px; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid var(--hx-divider); border-radius: 12px; padding: 16px 20px;
  box-shadow: var(--hx-elev-1); transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.hx-step:hover .hx-step-card { box-shadow: var(--hx-elev-4); border-color: var(--node); transform: translateX(3px); }
.hx-step-main { min-width: 0; flex: 1; }
.hx-step-title { font-size: 1.02rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em; color: var(--node); margin-bottom: 6px !important; }
.hx-bullets { list-style: none; padding: 0; display: grid; gap: 4px; }
.hx-bullets li { position: relative; padding-left: 14px; font-size: 0.87rem; line-height: 1.5; color: #374151; }
.hx-bullets li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--node); }
.hx-bullets b { color: #111827; font-weight: 700; }
.hx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding: 0; list-style: none; }
.hx-chips li {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.74rem; color: #1f2937;
  padding: 3px 10px; border-radius: 16px; background: var(--hx-chip); border: 1px solid #e0e0e0;
}
.hx-learn {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-width: 150px; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--hx-divider);
}
.hx-learn-tag { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; color: #fff; background: var(--node); padding: 2px 8px; border-radius: 4px; }
.hx-learn-icons { display: flex; gap: 12px; align-items: flex-start; justify-content: center; }
.hx-learn-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; text-align: center; }
.hx-learn-item span:first-child { width: 40px; height: 40px; border-radius: 10px; background: #fff; box-shadow: var(--hx-elev-1); display: grid; place-items: center; }
.hx-learn-item img { width: 24px; height: 24px; }
.hx-learn-item span:last-child { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--hx-text-2); line-height: 1.2; }

/* Sidebar cards */
.hx-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--nav-height, 74px) + 16px); }
.hx-card { background: #fff; border: 1px solid var(--hx-divider); border-radius: 12px; overflow: hidden; box-shadow: var(--hx-elev-1); }
.hx-card-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--head, #334155); }
.hx-card-head svg { width: 16px; height: 16px; }
.hx-card-body { padding: 14px 16px; display: grid; gap: 8px; }
.hx-tool { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px; background: #f8fafc; border: 1px solid var(--hx-divider); font-size: 0.86rem; font-weight: 500; }
.hx-skill { display: flex; gap: 10px; align-items: flex-start; padding-bottom: 8px; border-bottom: 1px dashed var(--hx-divider); }
.hx-skill:last-child { border-bottom: 0; padding-bottom: 0; }
.hx-skill > span { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--hx-accent); background: color-mix(in srgb, var(--hx-accent) 12%, #fff); }
.hx-skill svg { width: 16px; height: 16px; }
.hx-skill strong { display: block; font-size: 0.86rem; color: #111827; }
.hx-skill p { font-size: 0.78rem; color: var(--hx-text-2); line-height: 1.45; margin-top: 2px !important; }
.hx-fact dt { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hx-text-2); }
.hx-fact dd { margin: 2px 0 0; font-size: 0.86rem; font-weight: 500; color: #111827; }
.hx-facts { display: grid; gap: 10px; margin: 0; }

/* ---------- Architecture matrix ---------- */
.hx-matrix-head { padding: 22px 24px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.hx-matrix-head h2 { font-size: 1.5rem; font-weight: 700; color: #111827; margin-top: 4px !important; }
.hx-matrix-head p { color: var(--hx-text-2); margin-top: 6px !important; max-width: 760px; line-height: 1.55; font-size: 0.92rem; }
.hx-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--hx-text-2); }
.hx-legend i { width: 14px; height: 14px; border-radius: 3px; background: color-mix(in srgb, var(--hx-accent) 14%, #fff); border: 1px solid var(--hx-accent); }
.hx-table-wrap { overflow-x: auto; border-radius: 12px; background: #fff; box-shadow: var(--hx-elev-2); border: 1px solid var(--hx-divider); }
.hx-table { width: 100%; min-width: 1320px; border-collapse: separate; border-spacing: 0; font-size: 0.8rem; }
.hx-table th, .hx-table td { padding: 12px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #eef0f3; }
.hx-table thead th { position: sticky; top: 0; z-index: 2; background: #fafafa; border-bottom: 2px solid var(--hx-divider); }
.hx-table thead th:first-child, .hx-table tbody th { position: sticky; left: 0; z-index: 1; background: #fff; }
.hx-table thead th:first-child { z-index: 3; background: #fafafa; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hx-text-2); vertical-align: middle; }
.hx-col { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-decoration: none; color: #111827; font-weight: 700; font-size: 0.86rem; }
.hx-col span:first-child { width: 36px; height: 36px; border-radius: 10px; background: #fff; box-shadow: var(--hx-elev-1); display: grid; place-items: center; }
.hx-col img { width: 22px; height: 22px; }
.hx-col:hover { color: var(--hx-accent); }
.hx-row { display: flex; align-items: center; gap: 10px; min-width: 170px; font-weight: 700; font-size: 0.84rem; color: #111827; }
.hx-row span { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--row); }
.hx-row svg { width: 16px; height: 16px; }
.hx-row code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }
.hx-cell-icons { display: flex; gap: 4px; margin-bottom: 6px; }
.hx-cell-icons span { width: 26px; height: 26px; border-radius: 7px; background: #fff; border: 1px solid #eceff3; display: grid; place-items: center; }
.hx-cell-icons img { width: 16px; height: 16px; }
.hx-cell strong { display: block; color: #111827; font-size: 0.82rem; margin-bottom: 2px; }
.hx-cell p { color: #4b5563; line-height: 1.45; }
.hx-table tbody tr:hover td, .hx-table tbody tr:hover th { background: #f9fafb; }
.hx-table .is-current { background: color-mix(in srgb, var(--hx-accent) 7%, #fff); }
.hx-table thead .is-current { background: color-mix(in srgb, var(--hx-accent) 14%, #fff); border-bottom-color: var(--hx-accent); }
.hx-table tbody tr:hover .is-current { background: color-mix(in srgb, var(--hx-accent) 11%, #fff); }
.hx-table tbody tr:last-child > * { border-bottom: 0; }

@media (max-width: 1100px) {
  .hx-poster-body { grid-template-columns: 1fr; }
  .hx-side { position: static; }
  .hx-poster-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 680px) {
  .hx-page { padding: 16px 16px 28px; }
  .hx-poster { padding: 14px; }
  .hx-poster-head { padding: 18px; }
  .hx-head-art { display: none; }
  .hx-spine::before { left: 21px; }
  .hx-step-nodes .hx-step-icon { display: none; }
  .hx-step-nodes { align-self: flex-start; }
  .hx-step-card { flex-direction: column; align-items: stretch; padding: 14px; }
  .hx-learn { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hx-step-card { transition: none; }
  .hx-step:hover .hx-step-card { transform: none; }
}
