/* CY-SHOP — единственный лист стилей магазина.
 *
 * До него оформление жило в пяти копиях трёх поколений: витрина, две страницы
 * возврата, страницы оформления и панель — каждая со своим набором цветов и
 * шрифтов. Чинилась при этом одна копия, а расходились все: готический шрифт
 * без кириллицы, из-за которого витрина выглядела собранной из обрезков,
 * пережил свою починку на страницах возврата и в панели.
 *
 * Поэтому правило простое: цвет, шрифт и отступ задаются здесь и только здесь.
 * Страница может добавить своё поведение, но не свой вкус.
 *
 * Шрифты подключены здесь же по той же причине. Все три содержат кириллицу —
 * это проверяется тестом, потому что браузер о подмене шрифта не сообщает: он
 * молча берёт другой, и вёрстка разъезжается без единой ошибки в консоли.
 */
@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;800&family=Manrope:wght@400;500;600&family=JetBrains+Mono:wght@400;700&display=swap");

:root {
  color-scheme: dark;

  /* Тёмная основа с фиолетовым уклоном. Серый без уклона рядом с фиолетовым
     акцентом выглядит грязным, а не нейтральным. */
  --void: #08060d;
  --card: #100b1b;
  --card-2: #150e24;
  --edge: #2a1d45;
  --edge-lit: #4a2f7a;

  --ink: #f0ebf8;
  --dim: #8d82a8;
  --mute: #645a7d;

  --violet: #a855f7;
  --violet-2: #c084fc;
  --violet-3: #d8b4fe;

  /* Смысловые цвета отдельно от акцента: «хорошо» и «внимание» не должны
     зависеть от того, какой у магазина фирменный оттенок. */
  --ok: #4ade80;
  --warn: #fbbf24;

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --edge-radius: 3px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font: 500 15px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Свечение сверху. Фиксировано и не ловит нажатия: это фон, а не слой. */
.aura {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 50% -14%, rgba(168, 85, 247, .20), transparent 62%),
    radial-gradient(700px 460px at 92% 8%, rgba(109, 40, 217, .13), transparent 60%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 44px 20px 60px;
}

/* Узкая колонка для страниц с одним делом: оформление, заказ, вход. */
.page.narrow { max-width: 560px; }

/* ---------- шапка ---------- */

.site-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* Знак нарисован, а не набран. Шрифт с готическими буквами годился бы только
   на латиницу, и русские подписи рядом молча подменялись бы другим. */
.mark {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  display: block;
  filter: drop-shadow(0 0 16px rgba(168, 85, 247, .34));
}
.mark.small { width: 46px; height: 46px; }

.name { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 6.4vw, 46px);
  line-height: 1;
  letter-spacing: -.02em;
  background: linear-gradient(96deg, var(--ink) 20%, var(--violet-2) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}
h1.small { font-size: clamp(21px, 4.6vw, 27px); }

.tag { margin: 0; color: var(--dim); font-size: 14.5px; }

.eyebrow {
  font: 700 10.5px/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 8px;
}

/* ---------- полоса фактов ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  margin: 30px 0 0;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: var(--edge-radius);
  overflow: hidden;
}
.facts div { background: var(--card); padding: 13px 15px; }
.facts b {
  display: block;
  font: 700 10.5px/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--violet);
}
.facts span { display: block; margin-top: 6px; color: var(--dim); font-size: 13.5px; }

/* ---------- полки ---------- */

.shelf { margin: 46px 0 0; scroll-margin-top: 20px; }
.shelf-top { display: flex; align-items: baseline; gap: 12px; }

h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
  color: var(--ink);
}
.count { font: 700 11px/1 var(--font-mono); color: var(--mute); }
.rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--edge), transparent); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(292px, 1fr));
  gap: 16px;
  margin: 18px 0 0;
}

/* ---------- карточка ---------- */

.item, article, .box {
  position: relative;
  padding: 22px;
  border: 1px solid var(--edge);
  border-radius: var(--edge-radius);
  background: linear-gradient(165deg, var(--card-2), var(--card));
}
.item { display: flex; flex-direction: column; }

/* Уголки очерчивают карточку, не занимая места текстом. */
.item::before, .item::after,
article::before, article::after,
.box::before, .box::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  pointer-events: none;
  border: 1px solid var(--edge-lit);
  transition: border-color .2s ease;
}
.item::before, article::before, .box::before {
  top: -1px; left: -1px; border-right: 0; border-bottom: 0;
}
.item::after, article::after, .box::after {
  bottom: -1px; right: -1px; border-left: 0; border-top: 0;
}

.item { transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.item:hover {
  border-color: var(--edge-lit);
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(88, 28, 135, .30);
}
.item:hover::before, .item:hover::after { border-color: var(--violet); }

.head, .fam-top, .top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
}

h3, .name-text {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.badge {
  font: 400 10.5px/1.5 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 3px 8px;
  border: 1px solid var(--edge);
  border-radius: 2px;
  white-space: nowrap;
}

.price {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--edge-lit);
  border-radius: 2px;
  background: rgba(168, 85, 247, .10);
  font: 700 15px/1 var(--font-mono);
  color: var(--violet-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rub { display: block; margin-top: 4px; font-size: 10.5px; color: var(--mute); font-weight: 400; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.chips i {
  font-style: normal;
  padding: 4px 9px;
  border: 1px solid var(--edge);
  border-radius: 2px;
  background: rgba(255, 255, 255, .02);
  font: 400 10.5px/1.5 var(--font-mono);
  color: var(--dim);
}

.note { margin: 14px 0 0; color: var(--dim); font-size: 14px; line-height: 1.55; }

/* ---------- строки цены ---------- */

.tiers { margin: 16px 0 0; }

/* Строка цены — это форма: покупка начинается с неё, а не со ссылки на
   отдельную страницу товара. Лишний шаг между «хочу» и «плачу» теряет
   покупателя. */
.tier {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  margin: 0;
  border-top: 1px solid var(--edge);
}
.tier:first-child { border-top: 0; padding-top: 4px; }
.tier .term { flex: 1; font-size: 14px; color: var(--dim); }
.tier .cost {
  font: 700 14.5px/1 var(--font-mono);
  color: var(--violet-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- «готовится» ---------- */

.soon .item { background: none; border-style: dashed; }
.soon .item:hover { transform: none; box-shadow: none; border-color: var(--edge); }
.soon .item:hover::before, .soon .item:hover::after { border-color: var(--edge-lit); }
.soon h3 { color: var(--dim); font-size: 17px; }
.soon .price {
  background: none;
  border-color: var(--edge);
  color: var(--mute);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- шаги оформления ---------- */

.steps {
  display: flex;
  margin: 0 0 24px;
  border: 1px solid var(--edge);
  border-radius: var(--edge-radius);
  overflow: hidden;
}
.step { flex: 1; padding: 10px 14px; background: var(--card); border-right: 1px solid var(--edge); }
.step:last-child { border-right: 0; }
.step b {
  display: block;
  font: 700 10px/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute);
}
.step span { display: block; margin-top: 5px; font-size: 13px; color: var(--mute); }
.step.now { background: rgba(168, 85, 247, .12); }
.step.now b { color: var(--violet); }
.step.now span { color: var(--ink); }
.step.done b, .step.done span { color: var(--dim); }

/* ---------- поля и кнопки ---------- */

label { display: block; margin: 18px 0 0; color: var(--dim); font-size: 13.5px; }

input[type="email"], input[type="text"], input:not([type]), textarea {
  width: 100%;
  margin-top: 7px;
  padding: 11px 13px;
  border: 1px solid var(--edge);
  border-radius: 2px;
  background: #0b0714;
  color: var(--ink);
  font: 500 15px/1.4 var(--font-body);
}
textarea { min-height: 140px; font-family: var(--font-mono); font-size: 13px; }
input:focus, textarea:focus { outline: none; border-color: var(--violet); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 520px) { .pair { grid-template-columns: 1fr; } }

.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; color: var(--dim); font-size: 13.5px; }
.check input { margin: 2px 0 0; width: 17px; height: 17px; accent-color: var(--violet); flex: 0 0 auto; }

button, .button {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  border-radius: 2px;
  border: 1px solid var(--violet);
  color: #12081f;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(180deg, var(--violet-2), var(--violet));
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  transition: filter .18s ease;
}
button:hover, .button:hover { filter: brightness(1.12); }
button:focus-visible, .button:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 3px; }

/* Кнопка внутри строки цены — компактная и не тянется на всю ширину. */
.tier button {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 7px 14px;
  border-color: var(--edge-lit);
  background: rgba(168, 85, 247, .08);
  color: var(--ink);
  font-size: 11.5px;
  transition: background .18s ease, border-color .18s ease;
}
.tier button:hover { background: var(--violet); border-color: var(--violet); color: #12081f; filter: none; }

/* Второстепенное действие не должно выглядеть как главное. */
form.secondary button, button.secondary {
  background: none;
  color: var(--dim);
  border-color: var(--edge-lit);
}
form.secondary button:hover, button.secondary:hover {
  color: var(--ink);
  border-color: var(--violet);
  filter: none;
}

/* ---------- сообщения ---------- */

.msg {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--edge);
  border-left: 2px solid var(--violet);
  border-radius: 2px;
  background: var(--card);
  color: var(--dim);
  font-size: 13.5px;
}
.msg.bad { border-left-color: var(--warn); color: var(--ink); }
.msg.good { border-left-color: var(--ok); }
.msg ul { margin: 8px 0 0; padding-left: 18px; }

.hint { margin: 8px 0 0; font-size: 12.5px; color: var(--mute); line-height: 1.6; }
.hint b { color: var(--dim); font-weight: 600; }

code {
  font: 600 13px/1.5 var(--font-mono);
  color: var(--violet-2);
  background: rgba(168, 85, 247, .10);
  padding: 2px 6px;
  border-radius: 2px;
  word-break: break-all;
}

/* ---------- заказ ---------- */

.summary {
  margin: 20px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  font-size: 14.5px;
}
.summary dt { color: var(--mute); }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary .total { font: 700 19px/1 var(--font-mono); color: var(--violet-2); }

.key {
  margin: 18px 0 0;
  padding: 16px;
  border: 1px solid var(--edge-lit);
  border-radius: 2px;
  background: rgba(168, 85, 247, .08);
  font: 700 15px/1.5 var(--font-mono);
  color: var(--violet-2);
  word-break: break-all;
  user-select: all;
}

.attach {
  display: block;
  margin: 18px 0 0;
  padding: 11px;
  border-radius: 2px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--edge-lit);
  background: rgba(168, 85, 247, .10);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
}
.attach:hover { border-color: var(--violet); }

.recovery {
  margin: 20px 0 0;
  padding: 14px 16px;
  border: 1px dashed var(--edge-lit);
  border-radius: 2px;
  background: rgba(168, 85, 247, .05);
}
.recovery b {
  display: block;
  font: 700 10px/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--violet);
}
.recovery .code {
  display: block;
  margin: 9px 0 0;
  font: 700 17px/1.4 var(--font-mono);
  color: var(--ink);
  letter-spacing: .06em;
  user-select: all;
  word-break: break-all;
}
.recovery p { margin: 9px 0 0; font-size: 12.5px; color: var(--mute); }

/* Ожидание. Точки дышат — страница обновляется сама, и без движения она
   выглядит зависшей. */
.dots span {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--violet);
  opacity: .3;
  animation: pulse 1.2s infinite;
}
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- условия ---------- */

.terms { margin: 18px 0 0; padding: 0; list-style: none; }
.terms li { position: relative; padding-left: 20px; margin-top: 10px; color: var(--dim); font-size: 14px; }
.terms li::before {
  content: "";
  position: absolute;
  left: 0; top: .72em;
  width: 9px; height: 1px;
  background: var(--violet);
}
.terms b { color: var(--ink); font-weight: 600; }

/* ---------- панель владельца ---------- */

.meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 0;
  font: 400 11px/1.5 var(--font-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--mute);
}
.meta .waiting { color: var(--warn); }
.count.low { color: var(--warn); }

details { margin-top: 18px; border-top: 1px solid var(--edge); padding-top: 6px; }
summary { cursor: pointer; padding: 8px 0; color: var(--violet-2); font-size: 13.5px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+ "; font-family: var(--font-mono); }
details[open] summary::before { content: "− "; }
summary:hover { color: var(--ink); }

section { margin-top: 40px; }

/* ---------- подвал ---------- */

footer {
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.fine { margin: 0; font: 400 12.5px/1.6 var(--font-mono); color: var(--mute); }
.fine a { color: var(--violet-2); text-decoration: none; border-bottom: 1px solid rgba(192, 132, 252, .38); }
footer img { display: block; max-width: 100%; height: auto; opacity: .72; }

a { color: var(--violet-2); }
.back {
  display: inline-block;
  margin-top: 26px;
  color: var(--mute);
  font: 400 13px var(--font-mono);
  text-decoration: none;
}
.back:hover { color: var(--ink); }

/* ---------- рамка под фото ---------- */
/*
 * Рамка стоит и без картинки. Пустое место рядом с картинкой соседа читается
 * как поломка вёрстки, а не как «фотографии пока нет», и владелец узнаёт об
 * этом от покупателя.
 */

.shot {
  position: relative;
  margin: -22px -22px 18px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--edge);
  background: linear-gradient(150deg, var(--card-2), #0b0714);
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s cubic-bezier(.2, .7, .3, 1);
}
.item:hover .shot img { transform: scale(1.04); }

/* Пустая рамка: диагональная штриховка и точка в центре. Не «сломано», а
   «здесь будет фотография». */
.shot.empty {
  background-image:
    repeating-linear-gradient(135deg,
      rgba(168, 85, 247, .05) 0 10px, transparent 10px 20px);
}
.shot.empty span {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 34px; height: 34px;
  border: 1px solid var(--edge-lit);
  border-radius: 50%;
}
.shot.empty span::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 11px; height: 11px;
  border: 1px solid var(--edge-lit);
  border-radius: 2px;
}

/* ---------- наличие ---------- */

.badge.out { border-color: var(--warn); color: var(--warn); }
.wait {
  margin-left: 8px;
  font: 400 10px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--warn);
}

/* ---------- живая рамка карточки ---------- */
/*
 * Уголки при наведении не просто меняют цвет, а «проходят» по краю. Движение
 * подсказывает, что карточка нажимается, — до того, как покупатель это
 * проверит наугад.
 */

.item::before, .item::after { transition: border-color .2s ease, width .3s ease, height .3s ease; }
.item:hover::before, .item:hover::after { width: 26px; height: 26px; }

.family { overflow: hidden; }

.tier { transition: background .18s ease, padding-left .18s ease; }
.tier:hover {
  background: rgba(168, 85, 247, .06);
  padding-left: 8px;
}

/* ---------- переход к оплате ---------- */
/*
 * Между нажатием и платёжной страницей проходит секунда-другая: заказ
 * создаётся, подпись собирается, браузер уходит на чужой адрес. Без ответа на
 * нажатие покупатель жмёт кнопку второй раз — а это второй заказ.
 */

.leaving { pointer-events: none; }
.leaving::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(8, 6, 13, .72);
  backdrop-filter: blur(2px);
  animation: fade-in .25s ease both;
}

.leaving-note {
  position: fixed;
  z-index: 41;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: 20px 26px;
  border: 1px solid var(--edge-lit);
  border-radius: var(--edge-radius);
  background: linear-gradient(165deg, var(--card-2), var(--card));
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  animation: rise .3s cubic-bezier(.2, .7, .3, 1) both;
}
.leaving-note small {
  display: block;
  margin-top: 8px;
  font: 400 12px/1.5 var(--font-body);
  color: var(--dim);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise {
  from { opacity: 0; transform: translate(-50%, -42%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Кнопка, которую уже нажали, показывает это собой. */
button[aria-busy="true"] { opacity: .6; }

/* ---------- всплывающее окно товара ---------- */
/*
 * Открывается по имени товара и живёт на :target — без сценариев. Значит
 * работает и там, где сценарии не выполнились, а закрывается кнопкой,
 * клавишей Esc браузера и ссылкой на фон.
 */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(8, 6, 13, .74);
  backdrop-filter: blur(3px);
}
.sheet:target { display: grid; animation: fade-in .2s ease both; }
.sheet-body {
  position: relative;
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--edge-lit);
  border-radius: var(--edge-radius);
  background: linear-gradient(165deg, var(--card-2), var(--card));
  animation: rise .28s cubic-bezier(.2, .7, .3, 1) both;
}
.sheet-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--edge);
  border-radius: 2px;
  color: var(--dim);
  text-decoration: none;
  font: 400 16px/1 var(--font-mono);
}
.sheet-close:hover { color: var(--ink); border-color: var(--violet); }
.sheet-back {
  position: absolute;
  inset: 0;
  z-index: -1;
}

/* Появление карточек при первой отрисовке: витрина собирается, а не
   вываливается разом. Задержка небольшая — ждать покупатель не должен. */
.grid > * { animation: rise .34s cubic-bezier(.2, .7, .3, 1) both; }
.grid > *:nth-child(2) { animation-delay: .05s; }
.grid > *:nth-child(3) { animation-delay: .1s; }
.grid > *:nth-child(4) { animation-delay: .15s; }

/* Движение — приправа, а не смысл. Кому оно мешает, тот его не получит. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .item:hover { transform: none; }
  .dots span { opacity: .6; }
}
