/* Компоненты потребляют ТОЛЬКО var(--...) из tokens.css (APP_PLAN §5.5). */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font-head); line-height: var(--lh-tight); letter-spacing: -0.01em; }
h1 { font-weight: 800; }
h2, h3 { font-weight: 700; }
a { color: var(--brand); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
img, svg { max-width: 100%; }

/* ===== Каркас ===== */
.nc-main { max-width: var(--container); margin: 0 auto; padding: var(--sp-6) var(--sp-4) var(--sp-8); }

.nc-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: var(--hairline);
}
.nc-header-inner {
  max-width: var(--container); margin: 0 auto;
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
}
.nc-logo {
  font-family: var(--font-head); font-weight: 800; font-size: 1.35rem;
  color: var(--brand); text-decoration: none; letter-spacing: -0.02em; white-space: nowrap;
}
.nc-logo:hover { color: var(--brand-hover); }
.nc-nav { display: flex; gap: var(--sp-2); margin-left: auto; flex-wrap: wrap; }
.nc-nav a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 0.95rem;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-pill); transition: background .18s, color .18s;
}
.nc-nav a:hover { color: var(--brand); background: var(--brand-tint); }

.nc-footer {
  max-width: var(--container); margin: var(--sp-8) auto 0; padding: var(--sp-6) var(--sp-4);
  color: var(--ink-soft); font-size: var(--fs-small); border-top: var(--hairline);
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.nc-footer a { color: var(--ink-soft); }
.nc-footer a:hover { color: var(--brand); }

/* ===== Хлебные крошки ===== */
.nc-crumbs { color: var(--ink-faint); font-size: var(--fs-small); margin-bottom: var(--sp-4); }
.nc-crumbs a { color: var(--ink-soft); text-decoration: none; }
.nc-crumbs a:hover { color: var(--brand); text-decoration: underline; }

/* ===== Карточки-блоки (claymorphism-lite) ===== */
.nc-block {
  background: var(--surface);
  border: var(--hairline);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-1);
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-4) 0;
}
.nc-block > h2 { font-size: var(--fs-h2); margin: 0 0 var(--sp-4); }
.nc-block > h2:first-child { margin-top: 0; }
.nc-block h3 { font-size: var(--fs-h3); margin: var(--sp-4) 0 var(--sp-2); }

/* ===== Чипы (тактильные) ===== */
.nc-chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0; margin: 0; }
.nc-chip {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-4); min-height: 40px;
  border-radius: var(--r-pill);
  background: var(--surface-alt); border: 1px solid transparent;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.98rem;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
a.nc-chip:hover {
  background: var(--brand-tint); color: var(--brand-hover);
  transform: translateY(-1px); box-shadow: var(--shadow-1);
}
a.nc-chip:active { transform: translateY(0); }
.nc-chip--plain { color: var(--ink-soft); }
.nc-chip--mono { font-family: var(--font-mono); font-weight: 500; font-size: 0.9rem; letter-spacing: -0.02em; }
.nc-chip small { color: var(--ink-faint); font-weight: 500; }
.nc-chip--gender-m { color: var(--g-m); background: var(--g-m-bg); }
.nc-chip--gender-f { color: var(--g-f); background: var(--g-f-bg); }
.nc-chip--gender-u { color: var(--g-u); background: var(--g-u-bg); }
a.nc-chip--gender-m:hover { background: var(--g-m-bg); color: var(--g-m); filter: brightness(0.97); }
a.nc-chip--gender-f:hover { background: var(--g-f-bg); color: var(--g-f); filter: brightness(0.97); }
a.nc-chip--gender-u:hover { background: var(--g-u-bg); color: var(--g-u); filter: brightness(0.97); }

/* буквенная сетка — крупнее, ровнее */
.nc-letters .nc-chip { min-width: 48px; justify-content: center; font-size: 1.05rem; font-weight: 700; }

/* ===== Таблицы ===== */
.nc-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.nc-table th, .nc-table td { border-bottom: var(--hairline); padding: var(--sp-2) var(--sp-3); text-align: left; }
.nc-table th { color: var(--ink-soft); font-weight: 700; font-size: var(--fs-small); }

.nc-source-note { color: var(--ink-faint); font-size: var(--fs-small); }

/* ===== Кнопки (мягкий press) ===== */
.nc-btn, .nc-search button {
  font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); padding: var(--sp-3) var(--sp-5); min-height: 48px;
  background: var(--brand); color: #fff; border: 0; border-radius: var(--r-pill);
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow-pop);
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.nc-btn:hover, .nc-search button:hover { background: var(--brand-hover); color: #fff; transform: translateY(-2px); }
.nc-btn:active, .nc-search button:active { transform: translateY(0); box-shadow: var(--shadow-1); }
.nc-btn--ghost {
  background: var(--surface); color: var(--brand); box-shadow: none; border: 2px solid var(--brand-tint);
}
.nc-btn--ghost:hover { background: var(--brand-tint); color: var(--brand-hover); }

/* ===== Поиск ===== */
.nc-search { display: flex; gap: var(--sp-2); align-items: stretch; }
.nc-search input {
  font: inherit; padding: var(--sp-3) var(--sp-5); min-height: 48px; flex: 1; min-width: 0;
  border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink);
  transition: border-color .16s, box-shadow .16s;
}
.nc-search input::placeholder { color: var(--ink-faint); }
.nc-search input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-tint); }
.nc-header .nc-search { flex: 1; max-width: 340px; }
.nc-header .nc-search input { min-height: 42px; padding: var(--sp-2) var(--sp-4); }
.nc-header .nc-search button { min-height: 42px; padding: var(--sp-2) var(--sp-4); }

/* ===== Главная ===== */
.nc-hero {
  text-align: center; padding: var(--sp-7) var(--sp-4) var(--sp-6);
  background:
    radial-gradient(60% 90% at 50% -10%, var(--brand-tint), transparent 70%),
    radial-gradient(50% 70% at 90% 10%, var(--accent-tint), transparent 70%);
  border-radius: var(--r-l); margin-bottom: var(--sp-5);
}
.nc-hero h1 { font-size: var(--fs-hero); margin: 0 0 var(--sp-3); }
.nc-hero-sub { font-size: var(--fs-h3); color: var(--ink-soft); margin: 0 auto var(--sp-5); max-width: 42ch; }
.nc-hero .nc-search { max-width: 560px; margin: 0 auto var(--sp-4); }
.nc-cta-row { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

.nc-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.nc-section-head h2 { margin: 0; font-size: var(--fs-h2); }
.nc-section-head a { font-size: var(--fs-small); font-weight: 600; white-space: nowrap; }

/* ===== Страница имени ===== */
.nc-hero-name { display: flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; margin: var(--sp-2) 0 var(--sp-5); }
.nc-monogram { flex-shrink: 0; filter: drop-shadow(0 6px 16px rgba(120,80,40,0.14)); }
.nc-hero-name h1 { margin: 0 0 var(--sp-2); font-size: var(--fs-h1); }
.nc-hero-meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

.nc-gender {
  display: inline-flex; align-items: center; padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-small);
}
.nc-gender--m { color: var(--g-m); background: var(--g-m-bg); }
.nc-gender--f { color: var(--g-f); background: var(--g-f-bg); }
.nc-gender--u { color: var(--g-u); background: var(--g-u-bg); }

@media (min-width: 1024px) {
  .nc-name-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-5); align-items: start; }
  .nc-name-aside { position: sticky; top: 80px; }
}

/* ===== Сердечко ===== */
.nc-heart-form { display: inline-flex; margin: 0; }
.nc-heart {
  width: 48px; height: 48px; font-size: 22px; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center;
  border: 2px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-faint); cursor: pointer;
  transition: transform .16s ease, color .16s, background .16s, border-color .16s;
}
.nc-heart:hover { color: var(--brand); border-color: var(--brand-tint); transform: scale(1.06); }
.nc-heart[aria-pressed="true"] { color: #fff; background: var(--brand); border-color: var(--brand); }
.nc-heart[aria-pressed="true"]:hover { color: #fff; }

details summary { cursor: pointer; color: var(--ink-soft); font-weight: 600; }

/* ===== Пагинация ===== */
.nc-pagination { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin: var(--sp-6) 0; }
.nc-page {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0 var(--sp-3);
  border-radius: var(--r-s); border: var(--hairline); text-decoration: none;
  background: var(--surface); color: var(--ink); font-weight: 600;
}
.nc-page:hover { background: var(--brand-tint); color: var(--brand-hover); }
.nc-page--current { background: var(--brand); color: #fff; border-color: var(--brand); }

.nc-catalog-grid { gap: var(--sp-2); }

/* ===== Автокомплит ===== */
.nc-ac { position: relative; flex: 1; }
.nc-ac input { width: 100%; }
.nc-ac-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  margin: 0; padding: var(--sp-2); list-style: none;
  background: var(--surface); border: var(--hairline);
  border-radius: var(--r-m); box-shadow: var(--shadow-2);
}
.nc-ac-item { display: block; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-s); text-decoration: none; color: var(--ink); }
.nc-ac-item--active, .nc-ac-item:hover { background: var(--brand-tint); color: var(--brand-hover); }

/* ===== Фильтры подбора ===== */
.nc-filter-form label { display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-small); font-weight: 600; color: var(--ink-soft); }
.nc-filter-row { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.nc-filter-form select, .nc-filter-form input[type="number"], .nc-filter-form input[type="email"] {
  font: inherit; color: var(--ink); padding: var(--sp-2) var(--sp-3); min-height: 44px;
  border: 2px solid var(--line); border-radius: var(--r-s); background: var(--surface);
}
.nc-filter-form select:focus, .nc-filter-form input:focus { border-color: var(--brand); outline: none; }
.nc-filter-form input[type="number"] { width: 88px; }

/* ===== Избранное ===== */
.nc-fav-item { display: inline-flex; align-items: center; gap: var(--sp-1); }
.nc-fav-remove button { border: 0; background: none; color: var(--ink-faint); cursor: pointer; font-size: var(--fs-small); min-width: 32px; min-height: 32px; border-radius: var(--r-pill); }
.nc-fav-remove button:hover { color: var(--err); background: var(--surface-alt); }

/* ===== Пары ===== */
.nc-invite code { display: inline-block; padding: var(--sp-3) var(--sp-4); background: var(--surface-sunk); border-radius: var(--r-s); word-break: break-all; font-family: var(--font-mono); }
.nc-pair-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.nc-pair-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-2) 0; border-bottom: var(--hairline); }
.nc-pair-buttons { display: inline-flex; gap: var(--sp-1); flex-wrap: wrap; }
.nc-vote-form { display: inline; }
.nc-vote {
  font: inherit; font-weight: 600; font-size: var(--fs-small); padding: var(--sp-2) var(--sp-3); min-height: 40px;
  border: 2px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: all .16s;
}
.nc-vote:hover { border-color: var(--brand); color: var(--brand); }
.nc-vote--active { background: var(--brand); border-color: var(--brand); color: #fff; }
.nc-match-note { color: var(--ok); font-weight: 700; margin-left: var(--sp-2); }

/* ===== Формы/флеш ===== */
.nc-form-error { color: var(--err); font-weight: 600; }
.nc-flash {
  background: var(--accent-tint); color: var(--ink); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-m); border-left: 4px solid var(--accent); margin-bottom: var(--sp-4);
}

/* ===== Страница ошибки ===== */
.nc-error-page { text-align: center; padding: var(--sp-8) var(--sp-4); max-width: 560px; margin: 0 auto; }
.nc-error-page h1 { font-size: var(--fs-hero); margin-bottom: var(--sp-3); }
.nc-error-page .nc-search { max-width: 440px; margin: var(--sp-5) auto; }
.nc-admin-form { display: inline-flex; gap: var(--sp-1); margin: 0 var(--sp-1) var(--sp-1) 0; }

/* ===== pro-мир: API-страницы ===== */
.nc-pro { max-width: 900px; }
.nc-pro h1 { font-size: var(--fs-h1); }
.nc-lead { font-size: var(--fs-h3); color: var(--ink-soft); max-width: 62ch; }
.nc-method { scroll-margin-top: 80px; }
.nc-method h2 code { font-size: var(--fs-h3); background: var(--surface-alt); padding: 2px var(--sp-2); border-radius: var(--r-s); }
.nc-console {
  background: var(--console-bg, #0E1420); color: var(--console-text, #E4EAF2);
  padding: var(--sp-4) var(--sp-5); border-radius: var(--r-m); overflow-x: auto;
  font-size: var(--fs-small); line-height: 1.6;
}
.nc-pro code { font-family: var(--font-mono); background: var(--surface-alt); padding: 1px var(--sp-1); border-radius: 4px; font-size: 0.92em; color: var(--ink); }
/* Код внутри тёмной консоли: перебиваем .nc-pro code большей специфичностью. */
pre.nc-console code { background: none; padding: 0; color: var(--console-text); border-radius: 0; font-size: inherit; white-space: pre; }

/* ===== Мобильные ===== */
@media (max-width: 640px) {
  :root { --fs-hero: 2.2rem; --fs-h1: 1.8rem; --fs-h2: 1.4rem; }
  .nc-header .nc-search { display: none; }
  .nc-block { padding: var(--sp-4); }
  .nc-main { padding: var(--sp-4) var(--sp-3) var(--sp-7); }
}
