/* Homepage recreation: fixed directory rail, compact search portal and dense tool grid. */

:root {
  --accent: #5961f9;
  --accent-dark: #4650eb;
  --accent-soft: #eef0ff;
  --bg: #f5f6f8;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f3f6;
  --ink: #282a2d;
  --ink-soft: #515c6b;
  --ink-faint: #6c757d;
  --nav-icon: #343940;
  --line: #e8eaee;
  --line-strong: #dfe2e8;
  --header-height: 74px;
}

[data-theme="dark"] {
  --bg: #1b1d1f;
  --bg-elevated: #2c2e2f;
  --bg-subtle: #363738;
  --ink: #eef0f3;
  --ink-soft: #bcc1c8;
  --ink-faint: #858b94;
  --nav-icon: #e1e5eb;
  --line: #3a3d40;
  --line-strong: #4a4d51;
  --accent-soft: #34375f;
}

html { scroll-padding-top: 92px; }

body {
  position: relative;
  background: var(--bg);
  color: var(--ink);
}

body::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: 220px;
  right: 0;
  height: 550px;
  background:
    radial-gradient(circle at 25% 5%, rgba(197, 204, 255, 0.9), transparent 32%),
    radial-gradient(circle at 72% 2%, rgba(255, 210, 226, 0.7), transparent 29%),
    linear-gradient(180deg, #f8f9ff 0%, rgba(245, 246, 248, 0) 100%);
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 25% 5%, rgba(76, 82, 155, 0.42), transparent 32%),
    radial-gradient(circle at 72% 2%, rgba(105, 62, 82, 0.3), transparent 29%),
    linear-gradient(180deg, #242629 0%, rgba(27, 29, 31, 0) 100%);
}

.shell {
  width: calc(100% - 48px);
  max-width: 1900px;
  margin-inline: auto;
}

.top-ticker,
.hero-noise,
.hero-radar,
.trust-row,
.task-section,
.directory-section,
.insight-section,
.prompt-section,
.compare-section,
.academy-section,
.library-section,
.submit-cta { display: none !important; }

main {
  display: flex;
  width: calc(100% - 220px);
  min-width: 0;
  margin-left: 220px;
  flex-direction: column;
}

.site-header,
.site-footer {
  width: calc(100% - 220px);
  margin-left: 220px;
}

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.site-header.scrolled {
  border: 0;
  background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  box-shadow: 0 5px 24px rgba(31, 35, 48, 0.06);
  backdrop-filter: blur(14px);
}

.header-inner {
  justify-content: flex-start;
  min-height: 74px;
  gap: 20px;
}

.site-header .brand { display: none; }
.desktop-nav { gap: 6px; }

.desktop-nav a {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 5px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 400;
  line-height: 38px;
}

.desktop-nav a::after { display: none; }

.desktop-nav a:hover,
.desktop-nav a.active {
  background: color-mix(in srgb, var(--bg-elevated) 76%, transparent);
  color: var(--accent);
}

.header-actions { margin-left: auto; }

.header-actions > .ghost-button,
.header-actions > .primary-button { display: none; }

.header-actions .icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
}

.reference-sidebar {
  position: fixed;
  z-index: 130;
  top: 0;
  bottom: 0;
  left: 0;
  width: 220px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  box-shadow: 5px 0 24px rgba(31, 35, 48, 0.03);
}

.reference-sidebar-sticky {
  position: static;
  display: flex;
  height: 100%;
  flex-direction: column;
}

.reference-sidebar-brand {
  display: flex;
  min-height: 74px;
  align-items: center;
  gap: 11px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.reference-sidebar-brand .brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 9px;
}

.reference-sidebar-brand > span:last-child {
  display: grid;
  gap: 4px;
}

.reference-sidebar-brand strong {
  font-size: 17px;
  letter-spacing: -0.03em;
}

.reference-sidebar-brand small {
  color: var(--ink-faint);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.reference-sidebar-title {
  padding: 20px 25px 8px;
  color: var(--ink-faint);
  font-size: 11px;
}

#homeCategoryNav {
  display: grid;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 12px 16px;
  gap: 1px;
  scrollbar-width: thin;
}

.home-category-button {
  display: grid;
  width: 100%;
  min-height: 39px;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.home-nav-group { min-width: 0; }

.home-category-button:not(:has(.home-category-chevron)) {
  grid-template-columns: 22px minmax(0, 1fr);
}

.home-category-chevron {
  transition: transform 180ms ease;
}

.home-nav-group.expanded .home-category-chevron { transform: rotate(180deg); }

.home-subcategory-list {
  display: none;
  padding: 2px 0 7px 44px;
}

.home-nav-group.expanded .home-subcategory-list { display: grid; }

.home-subcategory-list button {
  position: relative;
  min-height: 29px;
  overflow: hidden;
  padding: 0 8px 0 12px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 18px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.home-subcategory-list button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -1px;
  width: 5px;
  height: 1px;
  background: var(--line-strong);
}

.home-subcategory-list button:hover,
.home-subcategory-list button.active {
  border-left-color: var(--accent);
  color: var(--accent);
}

.home-category-button i {
  color: var(--nav-icon);
  font-size: 18px;
  font-weight: 600;
}

.home-category-button span {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-category-button:hover,
.home-category-button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.home-category-button:hover i,
.home-category-button.active i { color: var(--accent); }

.reference-sidebar-footer {
  display: grid;
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line);
  gap: 2px;
}

.reference-sidebar-footer a {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border-radius: 5px;
  color: var(--ink-soft);
  font-size: 12px;
}

.reference-sidebar-footer a:hover {
  background: var(--bg-subtle);
  color: var(--accent);
}

.hero-section {
  order: 1;
  min-height: 0;
  overflow: visible;
  padding: 96px 0 46px;
  border: 0;
  background: transparent;
}

.hero-grid { display: block; }

.hero-copy {
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  text-align: center;
}

.hero-copy .eyebrow,
.hero-copy > p,
.popular-searches { display: none; }

.hero-copy h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hero-home-logo {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  margin: 8px 0 22px;
}

.hero-home-logo .brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.hero-home-logo strong {
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.065em;
}

.search-channel-tabs {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 10px;
}

.search-channel-tabs button {
  position: relative;
  padding: 5px 2px 9px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
}

.search-channel-tabs button.active {
  color: var(--accent);
  font-weight: 700;
}

.search-channel-tabs button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  border-radius: 3px;
  background: var(--accent);
}

.hero-search {
  position: relative;
  max-width: 660px;
  margin: 0 auto;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.search-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 52px;
  padding: 4px 5px 4px 18px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 80%, transparent);
  border-radius: 8px;
  background: var(--bg-elevated);
  box-shadow: 0 12px 28px rgba(44, 49, 86, 0.11);
}

.search-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 12px 28px rgba(44, 49, 86, 0.1);
}

.search-input-row > i { display: none; }

.search-input-row input {
  width: 100%;
  min-width: 0;
  font-size: 14px;
}

.search-input-row button {
  width: 44px;
  height: 42px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
}

.search-input-row button:hover { background: var(--accent-dark); }

.search-mode-row {
  display: flex;
  min-height: 36px;
  justify-content: center;
  overflow-x: auto;
  padding: 6px 0 0;
  border: 0;
  gap: 0;
  scrollbar-width: none;
}

.search-mode-row::-webkit-scrollbar { display: none; }

.search-mode {
  min-width: auto;
  padding: 4px 11px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-faint);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.search-mode:hover,
.search-mode.active {
  background: var(--bg-elevated);
  color: var(--accent);
}

.search-mode.active::after { display: none; }

.search-suggestions {
  z-index: 30;
  top: 57px;
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-elevated);
  box-shadow: 0 18px 44px rgba(31, 35, 48, 0.14);
}

.search-suggestions.open { position: absolute; }

.search-suggestions .suggestion-item { border-radius: 4px; }

.home-widget-group {
  display: grid;
  order: 2;
  grid-template-columns: 74px minmax(0, 1fr);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 7px 24px rgba(31, 35, 48, 0.05);
}

.home-widget-nav {
  display: grid;
  align-content: center;
  padding-right: 8px;
  border-right: 1px solid var(--line);
  gap: 3px;
}

.home-widget-nav button {
  display: grid;
  min-height: 55px;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}

.home-widget-nav button i { font-size: 18px; }
.home-widget-nav button span { font-size: 10px; }

.home-widget-nav button.active,
.home-widget-nav button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.home-channel-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 8px 8px 16px;
}

.home-channel-strip a {
  position: relative;
  display: flex;
  min-height: 112px;
  overflow: hidden;
  align-items: center;
  gap: 13px;
  padding: 18px;
  border-radius: 10px;
  color: #fff;
}

.home-channel-strip a::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -30px;
  width: 110px;
  height: 110px;
  border: 18px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.home-channel-strip a > i {
  position: relative;
  z-index: 1;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 21px;
}

.home-channel-strip span {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  gap: 5px;
}

.home-channel-strip strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-channel-strip small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.channel-news { background: linear-gradient(135deg, #5674ff, #8457ee); }
.channel-community { background: linear-gradient(135deg, #ff729d, #ff9a64); }
.channel-project { background: linear-gradient(135deg, #14a6a8, #53c59b); }
.channel-course { background: linear-gradient(135deg, #ff9c42, #f4c34d); }

.quick-dock {
  order: 3;
  margin-top: 28px;
  padding: 0;
  border: 0;
}

.dock-head { margin-bottom: 16px; }

.dock-head .section-kicker,
.dock-head .text-button { display: none; }

.dock-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

.dock-head h2::before {
  content: "\ea0a";
  color: #f15b50;
  font-family: remixicon;
  font-size: 18px;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0 16px;
}

.shortcut-item {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 78px;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 10px;
  row-gap: 1px;
  margin: 0 0 12px;
  padding: 13px 14px;
  border: 1px solid var(--bg-subtle);
  border-radius: 7px;
  background: var(--bg-elevated);
  cursor: pointer;
}

.shortcut-item:hover {
  border-color: var(--accent);
  transform: none;
  box-shadow: none;
}

.shortcut-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  border-radius: 50%;
}

.shortcut-item > span:last-child {
  display: contents;
  min-width: 0;
  text-align: left;
}

.shortcut-item strong,
.shortcut-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortcut-item strong {
  display: block;
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.shortcut-item small {
  display: block;
  min-width: 0;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}

.reference-directory {
  order: 4;
  padding: 18px 0 66px;
  border: 0;
  background: transparent;
}

.reference-directory-layout { display: block; }
.reference-directory-head { display: none; }

.home-category-group {
  scroll-margin-top: 92px;
  margin-bottom: 22px;
}

.home-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.home-category-head > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.home-category-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--accent);
  font-size: 17px;
}

.home-category-head h3 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
}

.home-category-head small { display: none; }

.home-category-head > a {
  color: var(--ink-faint);
  font-size: 12px;
}

.home-category-head > a:hover { color: var(--accent); }

.home-category-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0 16px;
}

.home-category-grid .tool-card {
  display: grid;
  min-width: 0;
  min-height: 78px;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 10px;
  row-gap: 1px;
  margin-bottom: 12px;
  padding: 13px 14px;
  border: 1px solid var(--bg-subtle);
  border-radius: 7px;
  background: var(--bg-elevated);
  cursor: pointer;
}

.home-category-grid .tool-card::after,
.home-category-grid .new-badge,
.home-category-grid .favorite-button,
.home-category-grid .tool-tags,
.home-category-grid .tool-meta,
.home-category-grid .tool-title small { display: none; }

.home-category-grid .tool-card:hover {
  border-color: var(--accent);
  transform: none;
  box-shadow: none;
}

.home-category-grid .tool-card-head { display: contents; }

.home-category-grid .tool-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  border-radius: 50%;
}

.home-category-grid .tool-title {
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
  align-self: end;
}

.home-category-grid .tool-title strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-category-grid .tool-card > p {
  display: block;
  min-height: 0;
  overflow: hidden;
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer {
  padding-top: 36px;
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
}

.site-footer .brand-copy small,
.site-footer p,
.site-footer a,
.site-footer h3,
.site-footer .footer-bottom { color: var(--ink-soft); }

.home-footer-grid {
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(130px, 0.7fr));
}

@media (max-width: 1399px) {
  .desktop-nav a {
    padding-inline: 8px;
    font-size: 14px;
  }

  .home-channel-strip {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    overflow-x: auto;
  }

}

@media (max-width: 1199px) {
  .desktop-nav a:nth-last-child(-n + 2) { display: none; }

  .shortcut-grid,
  .home-category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 999px) {

  .shortcut-grid,
  .home-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  body::before { left: 0; }

  main,
  .site-header,
  .site-footer {
    width: 100%;
    margin-left: 0;
  }

  .reference-sidebar { display: none; }

  .site-header {
    background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
    backdrop-filter: blur(14px);
  }

  .site-header .brand { display: inline-flex; }
  .desktop-nav { display: none; }
  .mobile-menu-button { display: inline-grid; }
  .header-inner { justify-content: space-between; }
  .hero-section { padding: 96px 0 34px; }
  .hero-home-logo strong { font-size: 33px; }
  .search-channel-tabs { gap: 20px; }

  .home-widget-group { grid-template-columns: 1fr; }

  .home-widget-nav {
    display: flex;
    padding: 0 0 7px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .home-widget-nav button {
    display: flex;
    min-height: 38px;
    flex: 1;
  }

  .home-channel-strip {
    grid-template-columns: repeat(4, 220px);
    padding-left: 8px;
  }

  .shortcut-grid,
  .home-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 10px;
  }

  .shortcut-item,
  .home-category-grid .tool-card { margin-bottom: 10px; }
  .home-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 460px) {
  .shell { width: calc(100% - 28px); }

  .hero-home-logo .brand-mark {
    width: 48px;
    height: 48px;
  }

  .hero-home-logo strong { font-size: 30px; }

  .search-channel-tabs {
    justify-content: space-between;
    gap: 0;
  }

  .search-mode { padding-inline: 8px; }

  .shortcut-item,
  .home-category-grid .tool-card {
    min-height: 66px;
    padding: 11px;
  }

  .shortcut-logo,
  .home-category-grid .tool-logo {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .home-category-grid .tool-card { grid-template-columns: 36px minmax(0, 1fr); }
  .home-footer-grid { grid-template-columns: 1fr; }
}
