/* Шрифты (self-hosted, variable, latin + latin-ext + cyrillic) */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("fonts/Manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("fonts/Manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("fonts/Manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/Inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/Inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/Inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Тёмная база: тёплый нейтральный, а не синий — под янтарный акцент */
  --bg: #121211;
  --bg-soft: #171716;
  --surface: #1c1c1a;
  --surface-2: #232321;
  --surface-3: #2b2b28;

  --border: #2e2e2b;
  --border-strong: #3d3d39;

  --text: #f2f1ee;
  --text-2: #c3c1bb;
  --text-3: #9a978f;

  /* Акцент из референса: rgb(255,193,118) */
  --accent: #ffc176;
  --accent-strong: #ffd47a;
  --accent-ink: #1a1508;
  --accent-dim: rgba(255, 193, 118, 0.14);
  --accent-line: rgba(255, 193, 118, 0.32);

  --font-display: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --r-pill: 9999px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 10px;

  --maxw: 1240px;
  --pad: 24px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0;
}

a { color: inherit; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translate(-50%, -200%);
  z-index: 200;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: transform 0.16s;
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ================= topbar ================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  background: rgba(18, 18, 17, 0.86);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-badge {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.logo-text em {
  font-style: normal;
  color: var(--accent);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }

.topnav a {
  padding: 7px 12px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.14s, background 0.14s;
}
.topnav a:hover { color: var(--text); background: var(--surface-2); }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.count-pill {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  white-space: nowrap;
}

.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.14s, transform 0.14s;
}
.gh-link:hover { background: var(--accent-strong); transform: translateY(-1px); }
.gh-link svg { width: 15px; height: 15px; fill: currentColor; }

/* ================= hero ================= */

.hero {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 56px);
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -50% 20% auto 20%;
  height: 420px;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 193, 118, 0.13), transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 13px;
  border-radius: var(--r-pill);
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.eyebrow .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 193, 118, 0.22);
}

.hero h1 {
  margin: 22px auto 0;
  max-width: 15em;
  font-size: clamp(34px, 6.2vw, 62px);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hero h1 .hl { color: var(--accent); }

.hero-sub {
  margin: 18px auto 0;
  max-width: 44em;
  color: var(--text-2);
  font-size: clamp(15px, 1.6vw, 17.5px);
  line-height: 1.6;
}

.hero-facts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.hero-facts li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 13.5px;
  color: var(--text-3);
}
.hero-facts b {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ================= controls ================= */

.controls {
  position: sticky;
  top: var(--topbar-h);
  z-index: 50;
  padding: 14px 0;
  background: rgba(18, 18, 17, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.searchbar:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px rgba(255, 193, 118, 0.1);
}

.searchbar .ico {
  width: 18px; height: 18px;
  flex-shrink: 0;
  fill: var(--text-3);
}

#q {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  background: none;
  border: 0;
  color: var(--text);
  font: 15.5px/1.4 var(--font-body);
}
#q::placeholder { color: var(--text-3); }
#q:focus { outline: none; }
#q::-webkit-search-cancel-button { display: none; }

.icon-btn {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: none;
  place-items: center;
  background: var(--surface-3);
  border: 0;
  border-radius: 50%;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.icon-btn:not([hidden]) { display: grid; }
.icon-btn:hover { background: var(--border-strong); color: var(--text); }

.sort-wrap { position: relative; flex-shrink: 0; }

#sort {
  appearance: none;
  padding: 9px 34px 9px 15px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font: 13.5px var(--font-body);
  cursor: pointer;
}
#sort:hover { color: var(--text); border-color: var(--border-strong); }
.sort-wrap::after {
  content: "";
  position: absolute;
  right: 14px; top: 50%;
  width: 7px; height: 7px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.chips {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.chips::-webkit-scrollbar { height: 5px; }
.chips::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font: 13.5px var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.14s, border-color 0.14s, background 0.14s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}

.chip .n {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.chip[aria-pressed="true"] .n { color: rgba(26, 21, 8, 0.62); }

:where(#q, #sort, .chip, .more-btn, .card-link, .gh-link, .topnav a, .icon-btn, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ================= section head ================= */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 34px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section-head h2 {
  font-size: clamp(21px, 2.6vw, 28px);
  font-weight: 800;
}

.section-head .sub {
  margin: 5px 0 0;
  font-size: 14px;
  color: var(--text-3);
}

#status {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ================= cards ================= */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color 0.16s, transform 0.16s, background 0.16s;
  min-width: 0;
}

.card:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.avatar {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
}

.card-id { min-width: 0; flex: 1; }

.card h3 {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.card-link {
  color: var(--text);
  text-decoration: none;
}
.card:hover .card-link { color: var(--accent); }

/* ссылка накрывает карточку, но текст остаётся выделяемым */
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
}

.card-owner {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

.card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.tag {
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-mut {
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 11.5px;
  white-space: nowrap;
}

.tag-warn {
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: rgba(255, 220, 116, 0.13);
  color: var(--accent-strong);
  font-size: 11.5px;
  white-space: nowrap;
}

.meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.meta .hearts { color: var(--accent); }

mark {
  background: rgba(255, 193, 118, 0.26);
  color: var(--text);
  border-radius: 3px;
  padding: 0 2px;
}

.empty {
  grid-column: 1 / -1;
  padding: 64px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.empty-hint {
  margin-top: 14px;
  font-size: 13.5px;
}

/* ================= pager / notes / footer ================= */

.pager {
  display: flex;
  justify-content: center;
  padding: 30px 0 10px;
}

.more-btn {
  padding: 12px 30px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  color: var(--text);
  font: 650 14.5px var(--font-body);
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.more-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.notes { margin: 12px 0 52px; }

.notes details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
}
.notes details[open] { padding-bottom: 20px; }

.notes summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.notes summary::-webkit-details-marker { display: none; }
.notes summary:hover { color: var(--text); }
.notes summary::before {
  content: "";
  width: 7px; height: 7px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.16s;
}
.notes details[open] summary::before { transform: rotate(45deg); }

.notes-body {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}
.notes-body p { margin: 0 0 12px; }
.notes-body strong { color: var(--text); }
.notes-body code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: 5px;
}

.unresolved-title {
  margin-top: 16px !important;
  color: var(--text) !important;
  font-weight: 600;
}

.unresolved {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--text-3);
}
.unresolved li { margin-bottom: 6px; }
.unresolved strong { color: var(--text-2); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 34px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer p {
  margin: 0;
  font-size: 13px;
  color: var(--text-3);
  max-width: 62ch;
}
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.to-top:hover { color: var(--accent); border-color: var(--accent-line); }

/* ================= adaptive ================= */

@media (max-width: 900px) {
  .topnav { display: none; }
}

@media (max-width: 700px) {
  :root { --pad: 16px; }
  .count-pill { display: none; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
  .hero-facts li { padding: 8px 13px; font-size: 12.5px; }
  .section-head { margin: 20px 0 14px; }
  #status { white-space: normal; }
}

@media (max-width: 420px) {
  .searchbar { padding-left: 13px; }
  #sort { padding: 9px 30px 9px 12px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
