:root {
  color-scheme: dark;
  --bg: #020a13;
  --bg-deep: #01070f;
  --surface: #0d151f;
  --surface-strong: #101a26;
  --surface-soft: #0a121c;
  --border: #1c2a38;
  --border-strong: #2b4152;
  --divider: #111c28;
  --text: #f4f7fa;
  --text-soft: #a2adba;
  --text-muted: #737f8e;
  --text-faint: #55616f;
  --cyan: #16d5ea;
  --cyan-strong: #2be7f1;
  --mint: #50dda8;
  --danger: #fb7185;
  --warning: #f9c74f;
  --radius-lg: 14px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --page-width: 1336px;
  --header-height: 70px;
  --focus: 0 0 0 3px rgba(22, 213, 234, 0.22);
  --font: Inter, "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  background:
    radial-gradient(circle at 78% 18%, rgba(6, 113, 126, 0.12), transparent 29rem),
    radial-gradient(circle at 24% 42%, rgba(16, 90, 107, 0.05), transparent 33rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--text);
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #00141b;
  background: var(--mint);
  border-radius: 8px;
  transform: translateY(-150%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--cyan-strong);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  height: var(--header-height);
  background: rgba(1, 7, 15, 0.94);
  border-bottom: 1px solid var(--divider);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  width: min(100%, 1488px);
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  font-size: 23px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.brand strong {
  color: var(--mint);
  font-weight: 760;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(22, 213, 234, 0.38);
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(22, 213, 234, 0.08), 0 0 20px rgba(22, 213, 234, 0.06);
}

.brand-mark i {
  font-size: 29px;
}

.primary-nav {
  display: flex;
  align-items: stretch;
  gap: 22px;
}

.nav-link,
.icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--text-soft);
}

.nav-link {
  gap: 9px;
  padding: 0 8px;
  font-size: 17px;
  font-weight: 520;
}

.nav-link i,
.icon-link i {
  font-size: 24px;
}

.nav-link::after {
  position: absolute;
  right: 4px;
  bottom: 0;
  left: 4px;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--cyan), var(--mint));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link.active::after {
  transform: scaleX(1);
}

.icon-link {
  margin-left: 8px;
  border-radius: 10px;
}

.icon-link:hover {
  color: var(--cyan);
  background: rgba(22, 213, 234, 0.07);
}

.hero {
  scroll-margin-top: var(--header-height);
  overflow-x: clip;
  padding: 45px 52px 28px;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 820px) minmax(390px, 1fr);
  gap: 44px;
  width: min(100%, var(--page-width));
  min-height: 462px;
  margin: 0 auto;
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 41px;
  margin: 0 0 14px;
  padding: 8px 16px;
  color: var(--text-soft);
  font-size: 15px;
  background: rgba(13, 21, 31, 0.78);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.hero h1 {
  margin: 0 0 20px;
  color: var(--text);
  font-size: clamp(46px, 4.35vw, 62px);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(100deg, var(--cyan), var(--mint));
  background-clip: text;
  -webkit-background-clip: text;
}

.recommend-form {
  display: block;
}

.intent-box {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 50px;
  align-items: center;
  min-height: 84px;
  padding: 0 16px 0 20px;
  background: linear-gradient(110deg, rgba(13, 21, 31, 0.98), rgba(15, 27, 39, 0.9));
  border: 1px solid var(--cyan);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px rgba(22, 213, 234, 0.04), 0 0 26px rgba(22, 213, 234, 0.035);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.intent-box:focus-within {
  border-color: var(--cyan-strong);
  box-shadow: var(--focus), 0 0 30px rgba(22, 213, 234, 0.06);
}

.intent-box > i {
  color: #8d9bab;
  font-size: 30px;
}

.intent-box input {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  color: var(--text);
  font-size: 20px;
  font-weight: 520;
  background: transparent;
  border: 0;
  outline: 0;
}

.intent-box input::placeholder {
  color: #d3dae1;
  opacity: 0.88;
}

.intent-submit {
  display: inline-grid;
  width: 46px;
  height: 46px;
  cursor: pointer;
  place-items: center;
  color: #00141b;
  background: linear-gradient(135deg, var(--cyan), var(--mint));
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(29, 220, 190, 0.16);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.intent-submit i {
  font-size: 24px;
}

.intent-submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.intent-submit:active {
  transform: translateY(1px);
}

.preference-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 106px;
  margin-top: 16px;
  padding: 18px 10px;
  background: rgba(14, 23, 34, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.preference {
  position: relative;
  min-width: 0;
  padding: 0 16px;
}

.preference + .preference {
  border-left: 1px solid var(--border);
}

.preference label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 560;
}

.preference label i {
  color: var(--text-soft);
  font-size: 19px;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  height: 41px;
  padding: 0 34px 0 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  font-weight: 520;
  appearance: none;
  background: #101923;
  border: 1px solid #293746;
  border-radius: 8px;
  outline: none;
}

.select-wrap select:hover {
  border-color: #405467;
}

.select-wrap select:focus-visible {
  border-color: var(--cyan);
  box-shadow: var(--focus);
}

.select-wrap > i {
  position: absolute;
  top: 50%;
  right: 11px;
  z-index: 1;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
  transform: translateY(-50%);
}

.primary-cta,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  cursor: pointer;
  border-radius: 11px;
  transition: transform 0.16s ease, border-color 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

.primary-cta {
  min-width: 248px;
  min-height: 56px;
  margin-top: 21px;
  color: #00131a;
  font-size: 19px;
  font-weight: 760;
  background: linear-gradient(105deg, var(--cyan), var(--mint));
  box-shadow: 0 10px 28px rgba(22, 213, 234, 0.09);
}

.primary-cta i {
  font-size: 22px;
}

.primary-cta:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.primary-cta:active {
  transform: translateY(1px);
}

.primary-cta:disabled {
  cursor: wait;
  filter: grayscale(0.3);
  opacity: 0.72;
  transform: none;
}

.primary-cta.compact {
  min-width: 0;
  min-height: 44px;
  margin-top: 0;
  font-size: 15px;
}

.secondary-button {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 620;
  background: rgba(13, 21, 31, 0.88);
  border: 1px solid var(--border-strong);
}

.secondary-button:hover {
  color: var(--text);
  border-color: var(--cyan);
  background: rgba(22, 213, 234, 0.05);
}

.hero-note {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--text-faint);
  font-size: 14px;
}

.radar-visual {
  position: absolute;
  z-index: 0;
  top: -52px;
  right: -50px;
  width: 540px;
  height: 540px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.9;
  mask-image: radial-gradient(circle, #000 57%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle, #000 57%, transparent 78%);
}

.radar-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.035);
  animation: radar-breathe 4.8s ease-in-out infinite;
}

.scan-status {
  position: absolute;
  z-index: 3;
  top: 7px;
  right: -2px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  margin: 0;
  padding: 8px 15px;
  color: var(--cyan-strong);
  font-size: 14px;
  font-weight: 650;
  background: rgba(8, 18, 27, 0.86);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(80, 221, 168, 0.8);
}

.scan-status.is-loading .status-dot {
  background: var(--cyan);
  animation: status-pulse 1s ease-in-out infinite;
}

.scan-status.is-error {
  color: #fecdd3;
}

.scan-status.is-error .status-dot {
  background: var(--danger);
}

.recommendations,
.library {
  width: min(calc(100% - 104px), var(--page-width));
  margin: 0 auto;
}

.recommendations {
  padding: 17px 0 35px;
  border-top: 1px solid var(--divider);
}

.section-heading,
.library-heading,
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.section-heading {
  min-height: 47px;
  margin-bottom: 8px;
}

.heading-copy {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.heading-icon {
  display: inline-grid;
  color: var(--cyan);
  place-items: center;
}

.heading-icon i {
  font-size: 26px;
}

.section-heading h2,
.library h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.sort-label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  color: var(--text-muted);
  font-size: 13px;
  background: rgba(13, 21, 31, 0.82);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.updated-meta {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  color: var(--text-faint);
  font-size: 13px;
}

.refresh-button,
.icon-button,
.modal-close {
  display: inline-grid;
  width: 42px;
  height: 42px;
  cursor: pointer;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  border-radius: 9px;
}

.refresh-button {
  width: 36px;
  height: 36px;
}

.refresh-button i,
.icon-button i,
.modal-close i {
  font-size: 21px;
}

.refresh-button:hover,
.icon-button:hover,
.modal-close:hover {
  color: var(--cyan);
  background: rgba(22, 213, 234, 0.07);
}

.refresh-button.is-loading i {
  animation: spin 0.8s linear infinite;
}

.recommendation-list {
  display: grid;
  gap: 8px;
}

.recommendation-row,
.recommendation-skeleton {
  min-height: 91px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.recommendation-row {
  display: grid;
  grid-template-columns: 42px 64px minmax(260px, 1fr) minmax(210px, 290px) 176px;
  align-items: center;
  gap: 22px;
  padding: 10px 22px;
  background: linear-gradient(98deg, rgba(13, 21, 31, 0.98), rgba(10, 19, 29, 0.88));
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.recommendation-row:hover {
  border-color: #2d4658;
  background: linear-gradient(98deg, rgba(15, 25, 37, 0.98), rgba(11, 22, 33, 0.92));
  transform: translateY(-1px);
}

.rank {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--cyan-strong);
  font-size: 16px;
  font-weight: 760;
  background: rgba(22, 213, 234, 0.11);
  border-radius: 50%;
}

.project-mark {
  display: grid;
  width: 62px;
  height: 62px;
  overflow: hidden;
  place-items: center;
  color: var(--text);
  background: #05090e;
  border: 1px solid #3a4b5b;
  border-radius: 9px;
}

.project-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-mark i {
  color: var(--text-soft);
  font-size: 32px;
}

.project-copy {
  min-width: 0;
}

.project-name {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 19px;
  font-weight: 720;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-name:hover {
  color: var(--cyan);
}

.project-description {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.project-meta {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.meta-line i {
  flex: 0 0 auto;
  color: var(--text-soft);
  font-size: 19px;
}

.meta-line .dot {
  color: #344353;
}

.meta-line.tags-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: grid;
  justify-items: stretch;
  gap: 4px;
}

.row-actions .primary-cta {
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 9px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  color: var(--text-muted);
  font-size: 13px;
}

.source-link:hover {
  color: var(--text);
}

.recommendation-skeleton {
  background:
    linear-gradient(90deg, rgba(13, 21, 31, 0.7) 0%, rgba(25, 38, 50, 0.82) 45%, rgba(13, 21, 31, 0.7) 100%);
  background-size: 240% 100%;
  animation: shimmer 1.25s linear infinite;
}

.empty-state,
.error-state {
  display: grid;
  min-height: 210px;
  padding: 28px;
  text-align: center;
  place-items: center;
  color: var(--text-soft);
  background: rgba(13, 21, 31, 0.6);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-state > div,
.error-state > div {
  max-width: 560px;
}

.empty-state i,
.error-state i {
  display: block;
  margin-bottom: 12px;
  color: var(--cyan);
  font-size: 36px;
}

.empty-state h3,
.error-state h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 20px;
}

.empty-state p,
.error-state p {
  margin: 0 0 18px;
}

.library {
  scroll-margin-top: calc(var(--header-height) + 18px);
  padding: 72px 0 64px;
  border-top: 1px solid var(--divider);
}

.library-heading {
  align-items: flex-end;
  margin-bottom: 25px;
}

.section-kicker,
.modal-kicker {
  margin: 0 0 7px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.14em;
}

.library h2 {
  font-size: 31px;
}

.library-heading p:not(.section-kicker) {
  max-width: 660px;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 15px;
}

.library-search {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  width: min(100%, 390px);
  min-height: 48px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.library-search:focus-within {
  border-color: var(--cyan);
  box-shadow: var(--focus);
}

.library-search i {
  color: var(--text-muted);
  font-size: 20px;
}

.library-search input {
  width: 100%;
  min-width: 0;
  padding: 11px 8px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.library-search input::placeholder {
  color: var(--text-faint);
}

.library-toolbar {
  margin-bottom: 16px;
}

.track-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.track-tab {
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.track-tab:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.track-tab.active {
  color: #00141b;
  font-weight: 720;
  background: var(--cyan);
  border-color: var(--cyan);
}

.library-count {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 13px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.library-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
  background: rgba(13, 21, 31, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.library-card:hover {
  border-color: #2c4658;
  transform: translateY(-1px);
}

.library-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.track-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 2px 9px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 680;
  background: rgba(22, 213, 234, 0.07);
  border: 1px solid rgba(22, 213, 234, 0.2);
  border-radius: 999px;
}

.library-card h3 {
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.library-card h3 a {
  overflow-wrap: anywhere;
}

.library-card h3 a:hover {
  color: var(--cyan);
}

.library-card .project-description {
  min-height: 43px;
  margin-top: 12px;
  -webkit-line-clamp: 2;
}

.tag-list,
.score-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.tag {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 2px 8px;
  color: var(--text-muted);
  font-size: 12px;
  background: #101923;
  border-radius: 6px;
}

.score-chip {
  color: var(--text-soft);
  font-size: 12px;
}

.score-chip b {
  color: var(--text);
  font-size: 13px;
}

.mvp-block {
  margin: 14px 0 0;
  padding: 11px 12px;
  color: var(--text-soft);
  font-size: 13px;
  background: rgba(22, 213, 234, 0.045);
  border-left: 2px solid var(--cyan);
  border-radius: 0 7px 7px 0;
}

.mvp-block strong {
  display: block;
  margin-bottom: 3px;
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.reference-details {
  margin-top: 13px;
  color: var(--text-muted);
  font-size: 12px;
}

.reference-details summary {
  cursor: pointer;
  color: var(--text-soft);
}

.reference-details ul {
  margin: 9px 0 0;
  padding-left: 18px;
}

.reference-details li + li {
  margin-top: 5px;
}

.reference-details a {
  color: var(--cyan);
}

.generation-error {
  margin-top: 12px;
  color: #fecdd3;
  font-size: 12px;
}

.library-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 17px;
}

.library-card-actions .primary-cta,
.library-card-actions .secondary-button {
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 0 13px;
  font-size: 13px;
  border-radius: 8px;
}

.vote-button {
  display: inline-flex;
  min-width: 66px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.vote-button:hover,
.vote-button.voted {
  color: var(--mint);
  border-color: rgba(80, 221, 168, 0.38);
  background: rgba(80, 221, 168, 0.05);
}

.vote-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(calc(100% - 104px), var(--page-width));
  margin: 0 auto;
  padding: 26px 0 34px;
  color: var(--text-faint);
  font-size: 13px;
  border-top: 1px solid var(--divider);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--cyan);
}

.modal {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  cursor: default;
  background: rgba(0, 4, 10, 0.82);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(860px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  flex-direction: column;
  padding: 24px;
  background: #0b141e;
  border: 1px solid #2a4050;
  border-radius: 16px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-head h2 {
  margin: 0;
  font-size: 25px;
}

.modal-close {
  flex: 0 0 auto;
}

.modal-sub {
  margin: 12px 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.prompt-box {
  min-height: 180px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #dce5ec;
  font: 13px/1.7 "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  background: #050b12;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.modal-foot {
  justify-content: flex-end;
  margin-top: 17px;
}

.toast {
  position: fixed;
  z-index: 400;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  background: #14212d;
  border: 1px solid #2d4557;
  border-radius: 10px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.noscript {
  position: fixed;
  z-index: 500;
  right: 20px;
  bottom: 20px;
  left: 20px;
  margin: 0;
  padding: 14px;
  color: #fff;
  text-align: center;
  background: #7f1d1d;
  border-radius: 10px;
}

@keyframes radar-breathe {
  0%,
  100% { opacity: 0.79; transform: scale(1.02); }
  50% { opacity: 0.96; transform: scale(1.055); }
}

@keyframes status-pulse {
  0%,
  100% { opacity: 0.55; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1.16); }
}

@keyframes shimmer {
  to { background-position: -140% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1180px) {
  .hero {
    padding-right: 38px;
    padding-left: 38px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 64%) minmax(320px, 36%);
    gap: 26px;
  }

  .radar-visual {
    right: -45px;
    width: 455px;
    height: 455px;
  }

  .recommendations,
  .library,
  .site-footer {
    width: min(calc(100% - 76px), var(--page-width));
  }

  .recommendation-row {
    grid-template-columns: 40px 58px minmax(240px, 1fr) minmax(180px, 230px) 160px;
    gap: 15px;
    padding-right: 15px;
    padding-left: 15px;
  }

  .project-mark {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 960px) {
  :root {
    --header-height: 66px;
  }

  .hero {
    padding: 38px 30px 30px;
  }

  .hero-inner {
    display: block;
    min-height: auto;
  }

  .hero-copy {
    max-width: 760px;
  }

  .radar-visual {
    top: -35px;
    right: -150px;
    width: 410px;
    height: 410px;
    opacity: 0.25;
  }

  .scan-status {
    top: 4px;
    right: 0;
  }

  .eyebrow {
    max-width: calc(100% - 180px);
  }

  .preference-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }

  .preference {
    padding: 12px;
  }

  .preference + .preference {
    border-left: 0;
  }

  .preference:nth-child(even) {
    border-left: 1px solid var(--border);
  }

  .preference:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .recommendations,
  .library,
  .site-footer {
    width: min(calc(100% - 60px), var(--page-width));
  }

  .recommendation-row {
    grid-template-columns: 38px 56px minmax(0, 1fr) 150px;
    grid-template-areas:
      "rank mark copy actions"
      "rank mark meta actions";
    gap: 4px 15px;
    min-height: 104px;
  }

  .recommendation-row .rank { grid-area: rank; }
  .recommendation-row .project-mark { grid-area: mark; }
  .recommendation-row .project-copy { grid-area: copy; }
  .recommendation-row .project-meta { grid-area: meta; }
  .recommendation-row .row-actions { grid-area: actions; }

  .project-meta {
    display: flex;
    gap: 15px;
  }

  .meta-line.tags-line {
    display: none;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .header-inner {
    padding: 0 18px;
  }

  .brand {
    gap: 9px;
    font-size: 18px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-mark i {
    font-size: 25px;
  }

  .primary-nav {
    gap: 6px;
  }

  .nav-link {
    gap: 6px;
    padding: 0 7px;
    font-size: 14px;
  }

  .nav-link i,
  .icon-link i {
    font-size: 21px;
  }

  .hero {
    padding: 30px 20px 26px;
  }

  .eyebrow {
    max-width: none;
    min-height: 36px;
    margin-bottom: 13px;
    padding: 6px 12px;
    font-size: 13px;
  }

  .hero h1 {
    font-size: clamp(40px, 10vw, 52px);
  }

  .scan-status {
    position: static;
    width: fit-content;
    margin: -5px 0 14px;
  }

  .radar-visual {
    top: 25px;
    right: -170px;
    width: 330px;
    height: 330px;
    opacity: 0.16;
  }

  .intent-box {
    grid-template-columns: 35px minmax(0, 1fr) 46px;
    min-height: 72px;
    padding-left: 15px;
  }

  .intent-box > i {
    font-size: 25px;
  }

  .intent-box input {
    padding-right: 9px;
    padding-left: 8px;
    font-size: 17px;
  }

  .intent-submit {
    width: 43px;
    height: 43px;
  }

  .preference-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }

  .preference {
    padding: 12px;
  }

  .preference + .preference {
    border-left: 0;
  }

  .preference:nth-child(even) {
    border-left: 1px solid var(--border);
  }

  .preference:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .primary-cta {
    width: 100%;
  }

  .recommendations,
  .library,
  .site-footer {
    width: calc(100% - 40px);
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 13px;
  }

  .updated-meta {
    align-self: stretch;
    justify-content: flex-end;
  }

  .recommendation-row {
    grid-template-columns: 36px 52px minmax(0, 1fr);
    grid-template-areas:
      "rank mark copy"
      "meta meta meta"
      "actions actions actions";
    gap: 10px 12px;
    padding: 14px;
  }

  .project-mark {
    width: 50px;
    height: 50px;
  }

  .project-name {
    font-size: 16px;
  }

  .project-description {
    -webkit-line-clamp: 2;
  }

  .project-meta {
    justify-content: space-between;
    padding-top: 9px;
    border-top: 1px solid var(--divider);
  }

  .row-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .source-link {
    min-height: 40px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 9px;
  }

  .library {
    padding-top: 54px;
  }

  .library-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .library h2 {
    font-size: 27px;
  }

  .library-search {
    width: 100%;
  }

  .library-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .radar-visual {
    display: none;
  }

  .brand span:last-child {
    max-width: 168px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .nav-link {
    width: 44px;
    padding: 0;
  }

  .icon-link {
    margin-left: 0;
  }

  .hero h1 {
    font-size: clamp(38px, 11.5vw, 46px);
  }

  .preference-panel {
    grid-template-columns: 1fr;
  }

  .preference:nth-child(even) {
    border-left: 0;
  }

  .preference:nth-child(n + 2) {
    border-top: 1px solid var(--border);
  }

  .heading-copy {
    flex-wrap: wrap;
  }

  .sort-label {
    margin-left: 36px;
  }

  .project-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .row-actions {
    grid-template-columns: 1fr;
  }

  .library-card-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .library-card-actions .primary-cta {
    flex: 1 1 55%;
  }

  .library-card-actions .secondary-button {
    flex: 1 1 35%;
  }

  .modal {
    padding: 12px;
  }

  .modal-card {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .modal-foot {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
