:root {
  --navy: #0a2540;
  --navy-soft: #16365c;
  --blue: #1d6fe0;
  --surface: #ffffff;
  --text: #0a2540;
  --muted: #5a6b80;
  --border: #e4e9f0;
  --radius: 16px;
  --shadow: 0 12px 30px -16px rgba(10, 37, 64, 0.28);
  --header-h: 72px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(29, 111, 224, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(10, 37, 64, 0.08), transparent 55%),
    #f5f8fc;
  -webkit-font-smoothing: antialiased;
}

/* The hub page locks to one viewport, no scroll */
body.page-hub { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

/* Header */
.site-header {
  height: var(--header-h);
  flex: 0 0 var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-logo { height: 44px; width: auto; display: block; }
.top-nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 26px;
  font-size: 0.92rem;
  font-weight: 600;
}
.top-nav a:hover { color: var(--blue); }

/* Hub layout — fills remaining height */
.hub {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 32px 18px;
  display: flex;
  flex-direction: column;
}

.hub-intro { flex: 0 0 auto; margin-bottom: 20px; }
.hub-intro h1 {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  color: var(--navy);
}
.hub-intro p { margin: 0; color: var(--muted); font-size: 1.02rem; }

/* 4 cards, fills the space between intro and footer */
.hub-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent, var(--blue));
}
.card:hover { transform: translateY(-6px); box-shadow: 0 22px 40px -18px rgba(10, 37, 64, 0.4); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.card-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.card-icon svg { width: 26px; height: 26px; }

.card-title { font-size: 1.18rem; font-weight: 700; line-height: 1.25; margin: 0 0 8px; color: var(--navy); }
.card-tagline { color: var(--muted); font-size: 0.92rem; margin: 0; flex: 1 1 auto; }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 60%; }
.tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: #eef3fb;
  color: #3a5172;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.card-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s ease, background 0.15s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent, var(--blue)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-ghost:hover { background: #f4f7fc; }

/* Footer */
.hub-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---- Detail / 404 pages (these may scroll normally) ---- */
.page-doc { background: #f5f8fc; }
.container { max-width: 880px; margin: 0 auto; padding: 0 32px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; margin: 32px 0 18px; font-weight: 600; }
.back-link:hover { color: var(--blue); }
.detail { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.detail::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent, var(--blue)); }
.detail-head { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; }
.detail-head h1 { margin: 0 0 6px; color: var(--navy); }
.detail-desc { color: #334155; margin: 0 0 20px; line-height: 1.6; }
.card-icon.lg { width: 64px; height: 64px; }
.hero { padding: 64px 0; text-align: center; }
.hero h1 { font-size: 2.4rem; color: var(--navy); margin: 0 0 8px; }
.hero p { color: var(--muted); }

/* Responsive: 2x2 grid on narrower screens, still no scroll */
@media (max-width: 1024px) {
  .hub-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  body.page-hub { overflow: auto; height: auto; min-height: 100vh; }
  .hub-grid { grid-template-columns: 1fr; }
  .card-tags { max-width: 100%; }
}
