/* Kulen Search — стили */

:root {
  --ink: #0e1116;
  --ink-soft: #2a3038;
  --muted: #6b7280;
  --muted-2: #9aa1ab;
  --line: #e9ebef;
  --line-strong: #d9dce2;
  --bg: #ffffff;
  --bg-soft: #fafafb;
  --accent: #ff5c35;
  --accent-soft: #fff1ec;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 2px 6px rgba(16, 24, 40, .05), 0 18px 40px -18px rgba(16, 24, 40, .18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Inter", system-ui, sans-serif;
  --wrap: 1180px;
}

* { box-sizing: border-box; }

/* Атрибут hidden должен побеждать любой display из классов */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ── Заставка «КУЛИО…» ──────────────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #fff;
  animation: splash-out .35s ease .7s forwards;
}

.splash-text {
  width: 150px;
  height: auto;
  animation: splash-pulse 1s ease-in-out infinite;
}

/* тонкая полоска под надписью — читается как «идёт загрузка» */
.splash-bar {
  width: 150px;
  height: 3px;
  border-radius: 3px;
  background: #f0eeec;
  overflow: hidden;
}

.splash-bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left center;
  animation: splash-fill .85s cubic-bezier(.3, .7, .3, 1) both;
}

@keyframes splash-fill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes splash-pulse {
  0%, 100% { opacity: .82; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.045); }
}

@keyframes splash-out {
  to { opacity: 0; visibility: hidden; }
}

img { display: block; max-width: 100%; }

button, input { font: inherit; color: inherit; }

a { color: inherit; }

::selection { background: var(--accent); color: #fff; }

/* ── Фон ─────────────────────────────────────────────── */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}

.blob-1 {
  width: 520px; height: 520px;
  top: -220px; right: -120px;
  background: radial-gradient(circle at 30% 30%, #ffd9cc, #ffe9e2 60%, transparent 72%);
}

.blob-2 {
  width: 460px; height: 460px;
  top: 220px; left: -200px;
  background: radial-gradient(circle at 50% 50%, #e4ecff, #eef2ff 60%, transparent 72%);
  opacity: .55;
}

/* ── Шапка ───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
  padding: 0 max(24px, calc((100vw - var(--wrap)) / 2));
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-mark-sm { width: 24px; height: 24px; border-radius: 6px; }

/* Скрыто визуально, но остаётся для скринридеров и SEO */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.brand-dot { color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.db-counter {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lucky-top {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s ease;
  white-space: nowrap;
}

.lucky-top:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── Общая сетка ─────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Hero ────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: 48px;
  padding: 64px 0 56px;
}

.hero-copy { min-width: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: .01em;
}

.eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.title {
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 5.6vw, 74px);
  line-height: 1.02;
  letter-spacing: -.035em;
}

.title-accent {
  color: var(--accent);
  position: relative;
  display: inline-block;
}

.title-accent::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: .06em;
  height: .12em;
  background: var(--accent-soft);
  border-radius: 999px;
  z-index: -1;
}

.lead {
  margin: 22px 0 0;
  max-width: 52ch;
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--muted);
}

/* ── Поиск ───────────────────────────────────────────── */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 8px 8px 8px 18px;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .22s ease, transform .18s ease;
}

.search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(14, 17, 22, .06), 0 18px 40px -22px rgba(16, 24, 40, .35);
}

.search-icon {
  width: 21px; height: 21px;
  flex: 0 0 auto;
  color: var(--muted-2);
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16.5px;
  letter-spacing: -.01em;
}

.search-input::placeholder { color: var(--muted-2); }

.clear-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  transition: .15s ease;
}

.clear-btn:hover { background: #eef0f3; color: var(--ink); }
.clear-btn svg { width: 15px; height: 15px; }

.search-btn {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 26px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: background .18s ease, transform .12s ease;
}

.search-btn:hover { background: var(--accent); }
.search-btn:active { transform: scale(.97); }

/* ── Чипы ────────────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: .16s ease;
  white-space: nowrap;
}

.chip .chip-count {
  font-size: 11px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.chip:hover { border-color: var(--line-strong); background: var(--bg-soft); }

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip.is-active .chip-count { color: rgba(255, 255, 255, .6); }

/* ── Маскот ──────────────────────────────────────────── */
.hero-art {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.art-frame {
  position: relative;
  width: 100%;
  max-width: 390px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(120% 90% at 70% 10%, #fff6f2 0%, #ffffff 55%),
    #fff;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.art-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(14,17,22,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14,17,22,.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(80% 70% at 50% 40%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 40%, #000 40%, transparent 100%);
  pointer-events: none;
}

.mascot {
  position: relative;
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 18px 26px rgba(16, 24, 40, .14));
  transform-origin: bottom center;
  animation: mascot-in .8s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes mascot-in {
  from { opacity: 0; transform: translateY(26px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.art-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 390px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.art-note-num {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--accent);
  padding-top: 2px;
}

/* ── Результаты ──────────────────────────────────────── */
.results-section { padding: 8px 0 72px; }

.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 18px;
  border-top: 1px solid var(--line);
}

.results-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.results-sub {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.sort {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.sort-btn {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: .15s ease;
  white-space: nowrap;
}

.sort-btn:hover { color: var(--ink); }

.sort-btn.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.results {
  display: grid;
  gap: 10px;
}

.card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .72);
  transition: border-color .18s ease, box-shadow .22s ease, transform .18s ease, background .18s ease;
  animation: card-in .45s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card:hover {
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-media {
  position: relative;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-media.has-thumb {
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-soft);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}

/* лёгкий зум превью при наведении на карточку */
.card:hover .card-media img,
.card:focus-within .card-media img {
  transform: scale(1.12);
}

.card-media .card-badge {
  min-width: 0;
  padding: 5px 9px;
  font-size: 12px;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 22%, #fff);
}

.card-body { min-width: 0; }

.card-top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.card-name {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  text-transform: lowercase;
}

.card-meta .sep { color: var(--line-strong); margin: 0 5px; }

.card-hint {
  margin-left: 7px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-2);
  letter-spacing: 0;
}

.card-desc {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 78ch;
}

.card-desc mark {
  background: var(--accent-soft);
  color: #c2410c;
  padding: 0 2px;
  border-radius: 3px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 2px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  transition: .15s ease;
  text-decoration: none;
}

.icon-btn:hover {
  background: var(--bg-soft);
  border-color: var(--line);
  color: var(--ink);
}

.icon-btn svg { width: 16px; height: 16px; }

/* ── Пустое состояние ────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 20px 56px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  background: rgba(255, 255, 255, .6);
}

.empty-mascot {
  width: 130px;
  opacity: .9;
  filter: grayscale(.15);
  margin-bottom: 8px;
}

.empty h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.empty p { margin: 0 0 18px; color: var(--muted); font-size: 14px; max-width: 46ch; }
.empty b { color: var(--ink); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: .16s ease;
}

.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .16s ease;
}

.btn-primary:hover { background: var(--accent); }

/* ── Футер ───────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 28px 24px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
}

.footer-joke { margin: 0; font-size: 12.5px; color: var(--muted); }
.footer-meta { margin: 0; font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

/* ── Модалка ─────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 17, 22, .38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .2s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 34px 34px 30px;
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 30px 80px -20px rgba(16, 24, 40, .4);
  animation: pop .32s cubic-bezier(.2, .9, .25, 1) both;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  transition: .15s ease;
}

.modal-close:hover { background: #eef0f3; color: var(--ink); }
.modal-close svg { width: 16px; height: 16px; }

.modal-kicker {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.modal-name {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 42px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.modal-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.modal-desc {
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

/* ── Тост ────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  z-index: 120;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5);
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── Адаптив ─────────────────────────────────────────── */
/* ── Персональный курсор (палец-маскот) ─────────────── */
/* Блок стоит в самом конце базовых стилей: у .chip и кнопок
   ниже по файлу есть свои cursor:pointer, их надо перебить.
   hotspot 5,1 — кончик пальца. */
html,
body {
  cursor: url("assets/cursor.png") 5 1, auto;
}

a, button, .chip, .card, .card-actions a, .icon-btn,
[role="button"], label, summary, .brand, .lucky-top, .sort-btn {
  cursor: url("assets/cursor.png") 5 1, pointer;
}

/* в поле поиска оставляем текстовый курсор — иначе не видно каретки */
input, textarea { cursor: text; }

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 44px 0 40px;
  }

  /* на узком экране лупа встаёт посреди страницы между чипами и
     результатами и съедает полэкрана — убираем её совсем.
     Маскот остаётся в логотипе и в пустом состоянии. */
  .hero-art { display: none; }
  .lead { max-width: none; }
}

@media (max-width: 680px) {
  .topbar { height: 64px; padding: 0 18px; }
  .wrap { padding: 0 18px; }
  .db-counter { display: none; }
  .title { font-size: clamp(36px, 10.5vw, 52px); }
  .lead { font-size: 15px; }

  .search { padding: 6px 6px 6px 14px; border-radius: 17px; }
  .search-btn { padding: 0 16px; height: 44px; font-size: 14px; }
  .search-input { font-size: 15px; height: 40px; }

  .results-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .results-tools { width: 100%; }
  .sort { width: 100%; }
  .sort-btn { flex: 1; text-align: center; }

  /* чипы — одной прокручиваемой строкой, чтобы не съедали экран */
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 16px -18px 0;
    padding: 0 18px 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }

  .card {
    grid-template-columns: 56px 1fr;
    gap: 10px 12px;
    padding: 14px;
  }

  .card-media { width: 56px; height: 56px; border-radius: 12px; }
  .card-body { grid-column: 2; }
  .card-actions { grid-column: 2; justify-content: flex-end; }

  .card-media .card-badge {
    min-width: 0;
    padding: 4px 8px;
    font-size: 11.5px;
  }

  .card-name { font-size: 17.5px; }
  .card-desc { font-size: 13.5px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .modal-card { padding: 28px 22px 24px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  /* заставку не показываем вовсе, а не «моргаем» ею */
  .splash { display: none; }
  .card:hover .card-media img,
  .card:focus-within .card-media img { transform: none; }
}
