/* SNIFF — оформление мини-приложения.
 *
 * ОТКУДА ВЗЯТ ЭТОТ ВИД. Толстая обводка, плотная плашка тени без размытия,
 * четыре чистых цвета и крупный дисплейный шрифт. Смысл не в моде: карточку
 * читают на телефоне, в потоке чужих сообщений, за три секунды. Вердикт должен
 * быть виден раньше, чем палец дотянется до прокрутки, поэтому он крупнее
 * всего остального в несколько раз, а не на пару пунктов.
 *
 * ДВИЖЕНИЕ ЗДЕСЬ РАБОТАЕТ, А НЕ УКРАШАЕТ:
 *   нос дышит, пока ждём ввода    -- показывает, что приложение живое;
 *   ноздри раздуваются при разборе -- занимает те три секунды, что идёт чтение;
 *   находки въезжают по очереди     -- взгляд ведут сверху вниз, по важности;
 *   штамп прилетает с ударом        -- вердикт запоминается телом, а не глазом.
 *
 * Всё движение выключается по prefers-reduced-motion: анимация, от которой
 * нельзя отказаться, -- это не выразительность, а навязчивость.
 */

:root {
  --ink:     #14121C;
  --paper:   #F4F3FA;
  --card:    #FFFFFF;
  --cobalt:  #2B3BF5;
  --lemon:   #FFE04D;
  --fuchsia: #FF3FA4;
  --mint:    #24DFA0;
  --grey:    #6E6B84;

  --display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --body:    'Manrope', system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  --line: 2.5px;
  --shadow: 4px 4px 0 var(--ink);
  --radius: 18px;
  --pad: 18px;

  --hole: var(--ink);
  --shine: #fff;
}

/* Тёмная тема Telegram: бумага и чернила меняются ролями, акценты остаются --
 * они и есть опознавательный знак. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14121C;
    --card:  #1E1B2A;
    --ink:   #F4F3FA;
    --grey:  #A29FB8;
    --shadow: 4px 4px 0 #000;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

.sprite { position: absolute; }
.mono { font-family: var(--mono); }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
  min-height: 100dvh;
}

.scene[hidden] { display: none !important; }
.scene { animation: scene-in .34s cubic-bezier(.2,.9,.25,1) both; }
@keyframes scene-in { from { opacity: 0; transform: translateY(12px); } }

/* ----------------------------------------------------------- бегущая --- */
.ticker {
  overflow: hidden;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: var(--lemon);
  color: var(--ink);
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.ticker__row {
  display: flex;
  gap: 30px;
  white-space: nowrap;
  padding: 7px 0;
  font: 700 12px/1 var(--mono);
  letter-spacing: .04em;
  animation: ticker 26s linear infinite;
  width: max-content;
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* -------------------------------------------------------------- герой --- */
.hero { text-align: center; padding: 8px 0 20px; }
.hero__mark { position: relative; display: inline-block; }

.mark { display: block; }
.mark--big { width: 118px; height: 118px; color: var(--lemon); animation: breathe 3.4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { transform: scale(1) rotate(0deg); }
  40%      { transform: scale(1.06) rotate(-2deg); }
  70%      { transform: scale(.985) rotate(1.5deg); }
}

/* Струйки воздуха: нос нюхает, и это видно. */
/* Струйки идут от носа. У знака нос в середине, у пса — на две трети вниз;
   первая версия пускала их изо лба, и это было видно на снимке экрана. */
.whiff {
  position: absolute; top: 62%; left: 50%;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cobalt); opacity: 0;
  animation: whiff 3.4s ease-out infinite;
}
.w1 { animation-delay: .1s; }
.w2 { animation-delay: .5s; background: var(--fuchsia); }
.w3 { animation-delay: .9s; background: var(--mint); }
@keyframes whiff {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(.4); }
  25%  { opacity: .95; }
  100% { opacity: 0; transform: translate(calc(-50% + 34px), -46px) scale(1.5); }
}

.hero__title {
  font: 900 44px/1 var(--display);
  letter-spacing: -.03em;
  margin: 12px 0 4px;
  text-transform: uppercase;
}
.hero__sub { margin: 0; color: var(--grey); font-size: 14.5px; max-width: 22em; margin-inline: auto; }

/* --------------------------------------------------------------- ввод --- */
.entry { margin-top: 22px; }
.entry__label {
  display: block;
  font: 800 11px/1 var(--body);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 8px;
}
.entry__field { position: relative; display: flex; }
.entry__input {
  flex: 1;
  font: 400 15px/1.2 var(--mono);
  padding: 15px 52px 15px 15px;
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
  min-width: 0;
}
.entry__input:focus {
  outline: none;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.entry__input.bad { animation: shake .38s; border-color: var(--fuchsia); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(4px); }
  50%      { transform: translateX(-4px); }
}
.entry__paste {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; padding: 8px;
  border: none; border-radius: 12px; background: transparent;
  color: var(--grey); cursor: pointer;
}
.entry__paste:active { color: var(--cobalt); transform: translateY(-50%) scale(.9); }
.entry__paste svg { width: 100%; height: 100%; }
.entry__hint { font-size: 12.5px; color: var(--grey); margin: 8px 2px 16px; min-height: 1.3em; }
.entry__hint.bad { color: var(--fuchsia); font-weight: 700; }

/* -------------------------------------------------------------- кнопки --- */
.btn {
  font-family: var(--body);
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn--go {
  display: block; width: 100%;
  font-weight: 800; font-size: 17px;
  padding: 16px;
  background: var(--cobalt); color: #fff;
  text-transform: uppercase; letter-spacing: .04em;
}
.btn--go[disabled] { opacity: .55; pointer-events: none; }
.btn--icon { width: 42px; height: 42px; padding: 9px; display: grid; place-items: center; flex: none; }
.btn--icon svg { width: 100%; height: 100%; }
.btn--ghost {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13px; padding: 10px 16px;
}
.btn--ghost svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------ обещания --- */
.promises { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.promises li {
  font-size: 13.5px; color: var(--grey);
  padding-left: 26px; position: relative;
}
.promises b { color: var(--ink); }
.promises li::before {
  content: ''; position: absolute; left: 0; top: .42em;
  width: 12px; height: 12px; border-radius: 50%;
  border: var(--line) solid var(--ink); background: var(--mint);
}

/* -------------------------------------------------------------- ждём --- */
.scene--wait { display: grid; place-items: center; gap: 20px; padding-top: 22vh; }
.sniffer { position: relative; width: 132px; height: 132px; }
.mark--wait { width: 132px; height: 132px; color: var(--cobalt); animation: hunt 1.5s ease-in-out infinite; }
@keyframes hunt {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50%      { transform: rotate(8deg) translateY(-6px); }
}
/* Ноздри раздуваются — видно, что нос работает, а не картинка висит. */
.mark--wait .nostril { animation: flare .62s ease-in-out infinite alternate; transform-origin: center; }
@keyframes flare { to { transform: scale(1.22); } }

.scanline {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 45%, color-mix(in srgb, var(--mint) 70%, transparent) 50%, transparent 55%);
  animation: scan 1.5s linear infinite;
  pointer-events: none;
  mix-blend-mode: multiply;
}
@keyframes scan { from { transform: translateY(-58px); } to { transform: translateY(58px); } }

.wait__what {
  font: 800 13px/1 var(--mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--grey); margin: 0;
}
.wait__bar {
  width: min(240px, 70vw); height: 10px;
  border: var(--line) solid var(--ink); border-radius: 999px;
  background: var(--card); overflow: hidden;
}
.wait__bar i { display: block; height: 100%; width: 40%; background: var(--lemon); animation: crawl 1.35s ease-in-out infinite; }
@keyframes crawl {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(260%); }
}

/* ------------------------------------------------------------- отчёт --- */
.rep__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.rep__id { min-width: 0; }
.rep__id b { display: block; font: 900 19px/1.1 var(--display); letter-spacing: -.02em; }
.rep__id span { display: block; font-size: 11px; color: var(--grey); overflow: hidden; text-overflow: ellipsis; }

.stamp {
  border: var(--line) solid var(--ink);
  border-radius: 24px;
  padding: 22px 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'word gauge' 'line gauge';
  align-items: center;
  gap: 4px 14px;
  animation: slam .5s cubic-bezier(.2,1.4,.35,1) both;
}
@keyframes slam {
  0%   { transform: scale(1.35) rotate(-5deg); opacity: 0; }
  60%  { transform: scale(.97) rotate(1.2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.stamp--danger  { background: var(--fuchsia); color: #fff; }
.stamp--caution { background: var(--lemon); }
.stamp--clear   { background: var(--mint); }
.stamp--unknown { background: var(--card); }

.stamp__word {
  grid-area: word;
  font: 900 34px/1 var(--display);
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.stamp__line { grid-area: line; font-size: 13px; opacity: .82; }

.gauge { grid-area: gauge; position: relative; width: 84px; height: 84px; }
.gauge__svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge__bg, .gauge__fg { fill: none; stroke-width: 11; stroke-linecap: round; }
.gauge__bg { stroke: color-mix(in srgb, currentColor 18%, transparent); }
.gauge__fg {
  stroke: currentColor;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1s cubic-bezier(.2,.9,.25,1) .25s;
}
.gauge__num {
  position: absolute; inset: 0; display: grid; place-content: center;
  font: 900 22px/1 var(--display);
}
.gauge__num i { font: 600 10px/1 var(--body); opacity: .6; font-style: normal; display: block; text-align: center; }

/* ------------------------------------------------------------ находки --- */
.findings { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.finding {
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  animation: rise .42s cubic-bezier(.2,.9,.25,1) both;
  animation-delay: calc(var(--i) * 55ms + .2s);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

.finding__top {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  cursor: pointer;
  user-select: none;
}
.finding__dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--ink); background: transparent;
  display: grid; place-items: center; font-size: 12px; line-height: 1;
}
/* Цвет ушёл в обводку, эмодзи осталась внутри на чистом фоне. Первая версия
   рисовала эмодзи поверх цветной заливки, и на розовом принтер превращался
   в грязное пятно — видно на снятом экране, не в тесте. */
.finding__dot::after { content: attr(data-emoji); }
.finding--red     .finding__dot { border-color: var(--fuchsia); }
.finding--amber   .finding__dot { border-color: #C9A400; }
.finding--green   .finding__dot { border-color: #12A877; }
.finding--unknown .finding__dot { border-color: var(--grey); border-style: dashed; }

.finding__title { font-weight: 700; font-size: 14.5px; }
.finding__value { font: 700 12px/1.25 var(--mono); text-align: right; }
.finding--red .finding__value { color: var(--fuchsia); }

.finding__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .32s cubic-bezier(.2,.9,.25,1);
}
.finding[open] .finding__body { grid-template-rows: 1fr; }
.finding__inner { overflow: hidden; }
.finding__pad { padding: 0 15px 15px; border-top: 2px dashed color-mix(in srgb, var(--grey) 40%, transparent); padding-top: 13px; }
.finding__explain { margin: 0 0 12px; font-size: 13.5px; }
.proofs { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.proofs li { font: 400 11.5px/1.4 var(--mono); word-break: break-all; color: var(--grey); }
.proofs b { color: var(--ink); font-weight: 700; }
.proofs .slot { color: var(--cobalt); }

.rep__gap {
  margin: 16px 0 0; padding: 13px 15px;
  border: var(--line) dashed var(--ink); border-radius: var(--radius);
  font-size: 13px; color: var(--grey); background: transparent;
}
.rep__foot { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rep__slot { font-size: 11px; color: var(--grey); }

/* -------------------------------------------------------------- отказ --- */
.scene--fail { display: grid; place-items: center; gap: 14px; padding-top: 18vh; text-align: center; }
.fail__mark .mark--big { color: var(--grey); animation: none; opacity: .45; }
.fail__title { font: 900 26px/1.1 var(--display); margin: 0; }
.fail__text { margin: 0; color: var(--grey); font-size: 14px; max-width: 24em; }
.scene--fail .btn--go { max-width: 260px; }

/* ------------------------------------------------------------- тостер --- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 24px);
  background: var(--ink); color: var(--paper);
  font: 700 13px/1 var(--body);
  padding: 12px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 40;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── ПЁС ────────────────────────────────────────────────────────────────
 *
 * Знак — это нос, и он живёт в иконке. Пёс целиком живёт здесь: на экранах,
 * в стикерах, в постах. Он и делает вердикт пересылаемым — скриншот с псом
 * уходит в чужой чат сам, и это единственная реклама, которая ничего не стоит.
 */
.dog { display: block; }
.dog--big { width: 132px; height: 132px; animation: breathe 3.4s ease-in-out infinite; }
.dog--wait { width: 136px; height: 136px; animation: hunt 1.5s ease-in-out infinite; }
/* Пёс нюхает: подпрыгивает и водит носом — из утверждённого прототипа. */
@keyframes hunt {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-8px) rotate(3deg); }
}
.dog--stamp { grid-area: dog; width: 74px; height: 74px; animation: pop .5s cubic-bezier(.2,1.5,.4,1) .1s both; }
@keyframes pop { from { transform: scale(0) rotate(-24deg); } }
.dog--chip { width: 46px; height: 46px; flex: none; }

/* Штамп получил третью колонку — пса. */
.stamp {
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'dog word gauge' 'dog line gauge';
}

/* ── НИЖНЯЯ НАВИГАЦИЯ ───────────────────────────────────────────────────
 *
 * Четыре раздела, как в крипто-приложениях, а не список экранов. Пустых
 * вкладок здесь нет: каждая показывает то, что мы действительно измерили.
 */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  border-top: var(--line) solid var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}
.nav button {
  background: none; border: 0; cursor: pointer;
  padding: 9px 4px 11px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-family: var(--body); font-size: 10px; font-weight: 700; color: var(--grey);
  border-top: 3px solid transparent;
  transition: color .14s ease, border-color .14s ease;
}
.nav button[aria-current='page'] { color: var(--cobalt); border-top-color: var(--cobalt); }
.nav button:focus-visible { outline: 2px solid var(--cobalt); outline-offset: -3px; }
.nav svg { width: 21px; height: 21px; }
/* Навигация закреплена внизу — её высота обязана быть вычтена из полосы
   прокрутки, иначе последняя строка отчёта уходит под неё. */
#app { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

/* ── ЛЕНТА, ТОП, ПРОФИЛЬ ────────────────────────────────────────────── */
.banner {
  display: flex; align-items: center; gap: 12px;
  border: var(--line) solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 14px;
}
.banner b { display: block; font: 800 15px/1.2 var(--display); letter-spacing: -.02em; }
.banner span { display: block; font-size: 12.5px; opacity: .8; margin-top: 2px; }
.banner--blue { background: var(--cobalt); color: #fff; }
.banner--lemon { background: var(--lemon); color: var(--ink); }
.banner--mint { background: var(--mint); color: var(--ink); }

.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.row {
  display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center;
  background: var(--card); border: var(--line) solid var(--ink); border-radius: 14px;
  padding: 9px 12px;
  animation: rise .38s cubic-bezier(.2,.9,.25,1) both;
  animation-delay: calc(var(--i) * 40ms);
}
.row__face { width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 11px; display: grid; place-items: center; font-size: 18px; }
.row__mint { display: block; font: 400 12px/1.3 var(--mono); word-break: break-all; }
.row__meta { display: block; font-size: 11px; color: var(--grey); margin-top: 2px; }
.row__tag { font: 700 11px/1 var(--mono); border: 2px solid var(--ink); border-radius: 20px; padding: 4px 9px; white-space: nowrap; }
.tag--danger { background: var(--fuchsia); color: #fff; }
.tag--caution { background: var(--lemon); color: var(--ink); }
.tag--clear { background: var(--mint); color: var(--ink); }
.tag--unknown { background: var(--card); color: var(--grey); border-style: dashed; }

.empty { font-size: 13px; color: var(--grey); text-align: center; padding: 22px 12px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tile {
  border: var(--line) solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px;
}
.tile b { display: block; font: 900 30px/1 var(--display); }
.tile span { display: block; font-size: 12px; margin-top: 4px; opacity: .85; }
.tile--pink { background: var(--fuchsia); color: #fff; }
.tile--blue { background: var(--cobalt); color: #fff; }

.meline {
  border: var(--line) dashed var(--ink); border-radius: var(--radius);
  padding: 12px 14px; font-size: 13px; color: var(--grey);
}
