@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,700;1,700&family=Poppins:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --hh-bg: #F1F1F1;
  --hh-black: #1B1918;
  --hh-blue: #7DD3FC;
  --hh-blue-dim: rgba(125,211,252,0.12);
  --hh-green: #65E499;
  --hh-yellow: #F4F7A6;
  --hh-pink: #FFA8D1;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
  --sidebar-width: 224px;
  --topbar-height: 50px;
}

html { font-size: 16px; }
body {
  background: var(--hh-bg);
  color: var(--hh-black);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--hh-black);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 10px;
  z-index: 100;
  border-bottom: 2px solid var(--hh-blue);
}
.topbar-logo {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--hh-bg);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.topbar-logo span { color: var(--hh-blue); }
.topbar-sep { color: rgba(241,241,241,0.2); font-size: 14px; }
.topbar-page { font-size: 13px; color: rgba(241,241,241,0.5); font-weight: 400; }
.topbar-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--hh-blue-dim);
  color: var(--hh-blue);
  padding: 3px 10px;
  border-radius: 20px;
  border: 0.5px solid rgba(125,211,252,0.3);
}

/* Layout */
.layout {
  display: flex;
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  padding: 28px 16px 40px;
  border-right: 1px solid rgba(27,25,24,0.08);
  background: rgba(241,241,241,0.6);
}
.sidebar-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #999;
  text-decoration: none;
  margin-bottom: 24px;
  transition: color .15s;
}
.sidebar-back:hover { color: var(--hh-black); }
.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bbb;
  margin-bottom: 6px;
  padding-left: 8px;
}
.sidebar a[href^="#"] {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #999;
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 6px;
  margin-bottom: 1px;
  transition: all .15s;
  border-left: 2px solid transparent;
}
.sidebar a[href^="#"]:hover { color: var(--hh-black); background: rgba(27,25,24,0.04); }
.sidebar a[href^="#"].active {
  color: var(--hh-black);
  background: var(--hh-blue-dim);
  border-left-color: var(--hh-blue);
  font-weight: 600;
}

/* Main content */
.main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: 780px;
}

/* Hero block */
.hero { margin-bottom: 40px; }
.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hh-black);
  opacity: 0.35;
  margin-bottom: 10px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 10px;
  color: var(--hh-black);
}
.hero-meta { font-size: 13px; color: #999; }

/* Sections */
.section { margin-bottom: 52px; scroll-margin-top: calc(var(--topbar-height) + 24px); }
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(27,25,24,0.08);
}
.section-num {
  width: 28px; height: 28px;
  background: var(--hh-blue);
  color: var(--hh-black);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-body);
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--hh-black);
}

/* Home page cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.card {
  background: #fff;
  border: 1px solid rgba(27,25,24,0.1);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s;
  display: block;
}
.card:hover { border-color: var(--hh-blue); transform: translateY(-1px); }
.card-accent {
  width: 32px; height: 4px;
  background: var(--hh-blue);
  border-radius: 2px;
  margin-bottom: 14px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--hh-black);
}
.card-desc { font-size: 12px; color: #888; line-height: 1.5; }
.category-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bbb;
  margin: 28px 0 10px;
}
.category-label:first-child { margin-top: 0; }

/* Responsive */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { padding: 28px 20px 60px; max-width: 100%; }
}

/* ── Homepage: search bar ─────────────────────────────── */
.home-search-bar {
  position: fixed;
  top: var(--topbar-height);
  left: 0; right: 0;
  height: 44px;
  background: #fff;
  border-bottom: 1px solid rgba(27,25,24,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  z-index: 90;
}
.home-search-icon { color: rgba(27,25,24,0.4); flex-shrink: 0; }
.home-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--hh-black);
  outline: none;
}
.home-search-input::placeholder { color: rgba(27,25,24,0.4); }
.home-search-kbd {
  font-size: 11px;
  color: rgba(27,25,24,0.4);
  border: 1px solid rgba(27,25,24,0.2);
  border-radius: 4px;
  padding: 2px 5px;
}

/* ── Homepage: two-column body ────────────────────────── */
.home-body {
  display: flex;
  margin-top: calc(var(--topbar-height) + 44px);
  min-height: calc(100vh - var(--topbar-height) - 44px);
}

/* ── Homepage: left nav ───────────────────────────────── */
.home-nav {
  width: 160px;
  flex-shrink: 0;
  background: #e8e8e6;
  border-right: 1px solid rgba(27,25,24,0.1);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: rgba(27,25,24,0.6);
  text-align: left;
  width: 100%;
  transition: background 0.1s, color 0.1s;
}
.home-nav-btn:hover { background: rgba(27,25,24,0.07); color: var(--hh-black); }
.home-nav-btn.active { background: var(--hh-black); color: #fff; }
.home-nav-label { flex: 1; }
.home-nav-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.1s;
}
.home-nav-btn.active .home-nav-dot { opacity: 1; }

/* ── Homepage: card panel ─────────────────────────────── */
.home-main {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
}
.home-panel { display: none; }
.home-panel.active { display: block; }
.home-search-panel { display: none; }
.home-panel-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.home-panel-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--hh-black);
}
.home-panel-count {
  font-size: 11px;
  font-weight: 600;
  color: rgba(27,25,24,0.35);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.home-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.home-card {
  background: #fff;
  border: 1px solid rgba(27,25,24,0.1);
  border-top: 3px solid var(--accent, var(--hh-blue));
  border-radius: 8px;
  padding: 14px 14px 12px;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s, transform 0.1s;
}
.home-card:hover { border-color: var(--accent, var(--hh-blue)); transform: translateY(-1px); }
.home-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hh-black);
  margin-bottom: 6px;
  line-height: 1.3;
}
.home-card-desc {
  font-size: 11px;
  color: rgba(27,25,24,0.55);
  line-height: 1.5;
}

/* ── Homepage: search results ─────────────────────────── */
.home-result-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.1s;
}
.home-result-item:hover { background: rgba(27,25,24,0.05); }
.home-result-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hh-black);
}
.home-result-meta {
  font-size: 11px;
  color: rgba(27,25,24,0.45);
}
.home-result-item mark {
  background: var(--hh-yellow);
  color: var(--hh-black);
  padding: 0 2px;
  border-radius: 2px;
}
.home-no-results {
  font-size: 13px;
  color: rgba(27,25,24,0.45);
  padding: 20px 0;
  text-align: center;
}

/* ── Homepage: responsive ─────────────────────────────── */
@media (max-width: 640px) {
  .home-nav { display: none; }
  .home-main { padding: 16px; }
  .home-body { flex-direction: column; }
}
