/* ==========================================================
   HOB — site styles
   ========================================================== */

:root {
  --bg: #0b0d12;
  --bg-2: #11141b;
  --panel: #161a23;
  --panel-2: #1c2130;
  --border: #242a39;
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --accent: #6aa7ff;
  --accent-2: #9a6cff;
  --ok: #4ad48f;
  --warn: #ffc76b;
  --bad: #ff7a7a;
  --max: 1180px;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Source Serif Pro", "Charter", "Georgia", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 18, 0.82);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text);
}
.brand-name { font-weight: 700; letter-spacing: 0.3px; }
.brand-sub {
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.1px;
}
@media (max-width: 640px) { .brand-sub { display: none; } }
.brand-badge {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: inline-block;
  position: relative;
}
.brand-badge::after {
  content: "H";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #0b0d12;
  font-weight: 900;
  font-size: 14px;
}
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--panel); }

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(106,167,255,0.10), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(154,108,255,0.10), transparent 50%);
}
.kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid rgba(106,167,255,0.35);
  border-radius: 999px;
  background: rgba(106,167,255,0.06);
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
  font-weight: 700;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede {
  font-size: 18px;
  color: var(--muted);
  max-width: 780px;
  margin: 0 0 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--panel-2); border-color: #33384a; text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border-color: transparent;
  color: #0b0d12;
}
.btn-primary:hover { filter: brightness(1.05); }

/* ---------- Generic sections ---------- */
section.block { padding: 72px 0; border-bottom: 1px solid var(--border); }
section.block h2 {
  font-family: var(--serif);
  font-size: 32px;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}
section.block h3 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 32px 0 10px;
}
section.block .sub {
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 780px;
}
.section-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.stat {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Quote block ---------- */
.quote {
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  background: var(--panel);
  border-radius: 0 10px 10px 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--text);
  margin: 24px 0;
}
.quote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  padding: 10px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data th:first-child, table.data td:first-child {
  text-align: left;
}
table.data thead th {
  background: var(--panel-2);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
}
table.data thead th:hover { color: var(--accent); }
table.data thead th.sort-asc::after  { content: " ▲"; color: var(--accent); }
table.data thead th.sort-desc::after { content: " ▼"; color: var(--accent); }
table.data tbody tr:hover { background: rgba(106,167,255,0.05); }
table.data tbody tr:last-child td { border-bottom: none; }

.pos { color: var(--ok); }
.neg { color: var(--bad); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* leaderboard rank */
.rank {
  display: inline-grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  margin-right: 10px;
}
.rank.top1 { background: linear-gradient(135deg, #f5c86a, #d4a036); color: #2a1d00; }
.rank.top2 { background: linear-gradient(135deg, #c8d0de, #8b94a4); color: #1a1f2b; }
.rank.top3 { background: linear-gradient(135deg, #d28c63, #a5613a); color: #2a160a; }

/* ---------- Heatmap (H x C) ---------- */
.heatmap {
  display: grid;
  grid-template-columns: 120px repeat(5, 1fr);
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.heatmap .cell {
  padding: 12px 10px;
  border-radius: 6px;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  color: #0b0d12;
  font-weight: 700;
  position: relative;
}
.heatmap .cell.label {
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.heatmap .cell.corner { background: transparent; }

/* ---------- Figures ---------- */
figure.fig {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
figure.fig img { display: block; width: 100%; }
figure.fig figcaption {
  padding: 12px 16px;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

/* Chart containers */
.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-card h4 { margin: 0 0 4px; font-size: 16px; }
.chart-card .cap { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.chart-box { position: relative; height: 340px; }

/* Pills / badges */
.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.04em;
}
.pill.ok { color: var(--ok); border-color: rgba(74,212,143,0.35); background: rgba(74,212,143,0.08); }
.pill.warn { color: var(--warn); border-color: rgba(255,199,107,0.35); background: rgba(255,199,107,0.08); }
.pill.bad { color: var(--bad); border-color: rgba(255,122,122,0.35); background: rgba(255,122,122,0.08); }

/* Code block */
pre.code {
  background: #0a0c12;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  color: #cfd5e1;
  line-height: 1.55;
}
pre.code .c { color: #7e8aa0; }
pre.code .k { color: #9a6cff; }
pre.code .s { color: #8fd6a0; }

/* ---------- Split layout (side-by-side) ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; gap: 48px; }
}
.split .card .stat { font-size: 34px; }
.split .card h4 { font-size: 15px; }
.split .card p { font-size: 13.5px; }

/* ---------- Chat dialog ---------- */
.chatbox {
  background: linear-gradient(180deg, #12151e 0%, #0e1118 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 20px 60px -25px rgba(106,167,255,0.25);
}
.split-left .chatbox { max-width: 100%; }
.chatbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.chatbox-dots { display: inline-flex; gap: 6px; }
.chatbox-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #2a3145;
}
.chatbox-dots span:nth-child(1) { background: #ff6b6b; }
.chatbox-dots span:nth-child(2) { background: #ffc76b; }
.chatbox-dots span:nth-child(3) { background: #4ad48f; }

.msg {
  display: flex;
  gap: 10px;
  margin: 10px 0;
  align-items: flex-start;
}
.msg .avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
}
.msg.user .avatar { background: linear-gradient(135deg, #6aa7ff, #9a6cff); color: #0b0d12; }
.msg.bot .avatar  { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }

.bubble {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  max-width: 100%;
}
.msg.user .bubble {
  background: rgba(106,167,255,0.10);
  border-color: rgba(106,167,255,0.25);
}
.msg.bot.wrong .bubble {
  background: rgba(255,122,122,0.08);
  border-color: rgba(255,122,122,0.28);
}
.msg.bot.right .bubble {
  background: rgba(74,212,143,0.08);
  border-color: rgba(74,212,143,0.32);
}
.msg .meta {
  display: block;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bubble .verdict {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.verdict.wrong { background: rgba(255,122,122,0.12); color: var(--bad); border: 1px solid rgba(255,122,122,0.3); }
.verdict.right { background: rgba(74,212,143,0.12); color: var(--ok); border: 1px solid rgba(74,212,143,0.3); }

.typing { display: inline-flex; gap: 4px; padding: 6px 2px; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.30s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* ---------- Footer ---------- */
.footer {
  padding: 40px 0 60px;
  color: var(--muted);
  font-size: 13.5px;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }

/* ---------- Utilities ---------- */
.spacer-lg { height: 36px; }
.spacer-md { height: 20px; }
.text-center { text-align: center; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 40px 0; }
.inline-code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 1px 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 5px;
}
