:root {
  color-scheme: dark;
  --bg: #09070f;
  --surface: #100c19;
  --surface-strong: #161021;
  --surface-soft: #0d0a14;
  --line: #2a2337;
  --line-strong: #4d3b60;
  --text: #f8f6fb;
  --muted: #958ca1;
  --muted-strong: #c6bdcf;
  --accent: #cf55ff;
  --accent-strong: #eb93ff;
  --accent-soft: rgba(207, 85, 255, 0.12);
  --shadow: rgba(0, 0, 0, 0.32);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --content-width: 1400px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body::selection {
  background: var(--accent);
  color: var(--bg);
}

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

button,
input {
  font: inherit;
}

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

button,
a {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 4px;
}

img {
  display: block;
  max-width: 100%;
}

.site-shell {
  width: min(calc(100% - 40px), var(--content-width));
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 14px;
  left: 14px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface-strong);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

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

.topbar {
  position: sticky;
  z-index: 10;
  top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 28px;
  min-height: 76px;
  margin-top: 16px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(12, 9, 18, 0.92);
  box-shadow: 0 16px 46px var(--shadow);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #05040a;
}

.brand__mark img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.brand__wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.brand__wordmark img {
  width: 144px;
  height: 22px;
  object-fit: contain;
  object-position: left center;
}

.brand__section {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topnav__link,
.locale-toggle {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topnav__link {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.topnav__link:hover,
.topnav__link--active {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.locale-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 0 12px;
  border-color: var(--line);
  background: transparent;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.locale-toggle:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.locale-toggle__active {
  display: inline-grid;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.locale-toggle__slash {
  color: var(--line-strong);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: clamp(48px, 8vw, 140px);
  align-items: end;
  min-height: 650px;
  padding: 112px 16px 104px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1.2;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 840px;
  margin: 0;
  color: var(--text);
  font-size: clamp(3.5rem, 8vw, 8.2rem);
  font-weight: 760;
  letter-spacing: -0.075em;
  line-height: 0.91;
}

.intro__text {
  max-width: 560px;
  margin: 34px 0 0;
  color: var(--muted-strong);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.65;
}

.intro__note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro__note-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(207, 85, 255, 0.12), 0 0 20px rgba(207, 85, 255, 0.72);
}

.intro__signal {
  display: grid;
  align-self: center;
  gap: 28px;
  min-height: 296px;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  box-shadow: 24px 34px 80px rgba(83, 35, 109, 0.18);
}

.signal-card__topline,
.signal-card__bottomline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.signal-card__status {
  color: var(--accent-strong);
}

.signal-card__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  min-height: 132px;
}

.signal-card__grid span {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.signal-card__grid span:nth-child(3n + 1) {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.signal-card__index {
  color: var(--text);
}

.catalog {
  padding: 112px 16px 0;
  scroll-margin-top: 108px;
}

.catalog__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 42px;
}

.catalog__heading .eyebrow {
  margin-bottom: 12px;
}

.catalog h2,
.add-guide h2 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 4.5rem);
  font-weight: 720;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.catalog h2 span,
.add-guide h2 span:last-child {
  color: var(--accent-strong);
}

.catalog__count {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.catalog__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.24fr);
  gap: clamp(24px, 5vw, 76px);
  align-items: start;
}

.projects-column {
  grid-column: 1;
}

.category-panel {
  position: sticky;
  grid-column: 2;
  min-width: 0;
  top: 112px;
  padding: 22px 0;
  border-top: 1px solid var(--line-strong);
}

.category-panel__heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 26px;
}

.category-panel__index,
.add-guide__number {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.category-panel h3 {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.category-list {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.category-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.category-button:hover,
.category-button.is-active {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.category-button.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.category-button__label {
  overflow: hidden;
  font-size: 13px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-button__count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.projects-column {
  min-width: 0;
}

.search-bar {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.search-bar__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.search-bar__field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-bar__field:focus-within {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(207, 85, 255, 0.08);
}

.search-bar__prefix {
  color: var(--accent-strong);
  font-weight: 800;
}

.search-bar input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search-bar input::placeholder {
  color: var(--muted);
}

.search-bar__shortcut {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.projects-list {
  display: grid;
  gap: 14px;
}

.project-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 118px;
  gap: 22px;
  align-items: center;
  min-height: 208px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.14);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.project-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 22px 60px rgba(72, 30, 91, 0.18);
  transform: translateY(-2px);
}

.project-card--featured {
  border-color: #634674;
  box-shadow: 0 22px 68px rgba(112, 42, 147, 0.18);
}

.project-card__logo {
  display: grid;
  position: relative;
  width: 92px;
  height: 92px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface-soft);
}

.project-card__logo.has-image {
  background: #07050b;
}

.project-card__logo img,
.project-card__logo-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__logo img {
  position: relative;
  z-index: 1;
}

.project-card__logo-fallback {
  display: grid;
  position: absolute;
  inset: 0;
  place-items: center;
  color: var(--accent-strong);
  font-size: 32px;
  font-weight: 760;
  letter-spacing: -0.08em;
}

.project-card__logo.is-fallback {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(207, 85, 255, 0.08), 0 0 26px rgba(207, 85, 255, 0.12);
}

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

.project-card__header,
.project-card__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.project-card__category {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-card__title {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.project-card__featured {
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid rgba(207, 85, 255, 0.35);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-card__description {
  max-width: 680px;
  margin: 14px 0 18px;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.55;
}

.project-card__footer {
  align-items: center;
}

.project-card__tags,
.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag,
.project-link {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.tag {
  color: var(--muted);
}

.project-link {
  border-color: rgba(207, 85, 255, 0.32);
  color: var(--accent-strong);
  transition: background 160ms ease, border-color 160ms ease;
}

.project-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.project-card__metric {
  display: grid;
  align-content: center;
  min-height: 94px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
  text-align: right;
}

.project-card__metric-value {
  color: var(--text);
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  font-weight: 730;
  letter-spacing: -0.08em;
  line-height: 1;
}

.project-card__metric-label {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.empty-state {
  padding: 54px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-state__code {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.empty-state h3 {
  margin: 18px 0 8px;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.empty-state p {
  margin: 0 auto 24px;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.button--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.button--accent {
  min-width: 160px;
  background: var(--accent);
  color: #160a1c;
  box-shadow: 0 10px 30px rgba(207, 85, 255, 0.2);
}

.button--accent:hover {
  background: var(--accent-strong);
}

.add-guide {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin: 112px 16px 0;
  padding: 30px 0 38px;
  border-top: 1px solid var(--line);
}

.add-guide__content .eyebrow {
  margin-bottom: 14px;
}

.add-guide h2 {
  max-width: 760px;
  font-size: clamp(2.2rem, 5vw, 5rem);
}

.add-guide p:last-child {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted-strong);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 90px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--accent-strong);
  font-size: 10px;
  letter-spacing: -0.06em;
}

.footer__meta {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    order: 3;
    margin: -4px -6px 0;
  }

  .intro {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 92px;
  }

  .intro__signal {
    max-width: 580px;
  }

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

  .category-panel {
    position: static;
    grid-column: auto;
    grid-row: 1;
    padding-bottom: 6px;
    border-top: 0;
  }

  .category-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
  }

  .category-button {
    flex: 0 0 auto;
    min-width: max-content;
    border-color: var(--line);
  }

  .projects-column {
    grid-column: auto;
    grid-row: 2;
  }
}

@media (max-width: 680px) {
  .site-shell {
    width: min(calc(100% - 24px), var(--content-width));
  }

  .topbar {
    top: 8px;
    gap: 12px;
    min-height: 68px;
    margin-top: 8px;
    padding: 10px;
    border-radius: 14px;
  }

  .brand__mark {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .brand__mark img {
    width: 27px;
    height: 27px;
  }

  .brand__wordmark img {
    width: 112px;
    height: 18px;
  }

  .brand__section {
    font-size: 10px;
  }

  .topnav {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topnav__link {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .locale-toggle {
    min-height: 40px;
    padding-left: 8px;
    font-size: 12px;
  }

  .locale-toggle__active {
    min-width: 30px;
    min-height: 30px;
  }

  .intro,
  .catalog {
    padding-right: 4px;
    padding-left: 4px;
  }

  .intro {
    gap: 52px;
    padding-top: 78px;
    padding-bottom: 72px;
  }

  .intro h1 {
    font-size: clamp(3.05rem, 15vw, 5.6rem);
  }

  .intro__signal {
    min-height: 248px;
    padding: 18px;
  }

  .catalog {
    padding-top: 76px;
  }

  .catalog__heading {
    display: block;
    padding-bottom: 28px;
  }

  .catalog__count {
    margin-top: 18px;
  }

  .project-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 16px;
    min-height: auto;
    padding: 16px;
    border-radius: 20px;
  }

  .project-card__logo {
    width: 64px;
    height: 64px;
    border-radius: 15px;
  }

  .project-card__logo-fallback {
    font-size: 24px;
  }

  .project-card__header {
    display: block;
  }

  .project-card__featured {
    display: inline-flex;
    margin-top: 10px;
  }

  .project-card__description {
    grid-column: 1 / -1;
    margin-top: 4px;
    margin-bottom: 16px;
  }

  .project-card__footer {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
  }

  .project-card__metric {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 9px;
    min-height: auto;
    padding: 13px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
    text-align: left;
  }

  .project-card__metric-label {
    margin-top: 0;
  }

  .add-guide {
    grid-template-columns: 30px 1fr;
    gap: 12px;
    margin: 78px 4px 0;
    padding-top: 24px;
  }

  .add-guide .button {
    grid-column: 2;
    justify-self: start;
  }

  .footer {
    display: grid;
    gap: 14px;
    min-height: 124px;
    padding: 24px 4px;
  }

  .footer__brand {
    align-items: flex-start;
  }

  .footer__meta {
    padding-left: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
