@import url('fonts.css');

/* ============================================================
   Ихтиодиагностика — светлый интерфейс поверх тёмного фото.
   Принцип: реальное фото water.png как фон, светлые «стеклянные»
   поверхности и тёмно-сине-серый текст поверх.
   ============================================================ */

:root {
  /* акценты */
  --accent-teal: #00c2d4;
  --accent-blue: #2f86eb;
  /* текст на светлом */
  --ink: #0a2540;
  --ink-soft: #34516b;
  --ink-faint: #5b7287;
  /* стеклянные поверхности */
  --glass-fill: rgba(255, 255, 255, 0.78);
  --glass-fill-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 18px 50px -12px rgba(5, 22, 40, 0.45);
  --chip-fill: rgba(255, 255, 255, 0.9);
  --chip-blur: blur(14px) saturate(1.2);
  --chip-shadow: 0 10px 30px -10px rgba(5, 22, 40, 0.5);
  /* кнопки (градиент строится из акцентов — единый источник цвета) */
  --btn-grad: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-blue) 100%);
  --btn-grad-hover: linear-gradient(135deg, #14d0e0 0%, #4a97f2 100%);
  /* радиусы */
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  /* шкала переходов */
  --t-fast: 0.18s ease;
  --t-base: 0.25s ease;
  --t-slow: 0.4s ease;
  /* шкала слоёв (z-index) */
  --z-bg: -2;
  --z-fx: -1;
  --z-content: 2;
  --z-topbar: 3;
  /* safe areas */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background-color: #06121f; /* пока грузится фото — тёмный тон, без белой вспышки */
  line-height: 1.5;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Кастомный курсор (десктоп): аккуратное кольцо-«пузырёк».
   PNG первым — Chrome/Windows стабильнее с растровым курсором; SVG — фолбэк. */
@media (hover: hover) and (pointer: fine) {
  body { cursor: url("/assets/images/cursor.png") 14 14, url("/assets/images/cursor.svg") 14 14, auto; }
  a, a *, button, button *, .btn, .btn *, .dropzone, .dropzone *,
  [role="button"], [role="button"] *, label, summary,
  .hero__fish, .hero__fish * {
    cursor: url("/assets/images/cursor-pointer.png") 16 16, url("/assets/images/cursor-pointer.svg") 16 16, pointer;
  }
  /* отключённая кнопка — системный «недоступно» (это корректное поведение) */
  .btn[disabled], .btn.is-disabled, .btn[disabled] * { cursor: not-allowed; }
}

img { max-width: 100%; display: block; }

a { color: inherit; }

/* Видимый фокус через outline — не обрезается overflow:hidden у кнопок/дропзоны */
:focus-visible { outline: 3px solid var(--accent-blue); outline-offset: 2px; }

/* Ссылка «к содержимому» для пользователей клавиатуры/скринридеров */
.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 999;
  padding: 10px 16px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border-radius: var(--r-sm);
  box-shadow: var(--glass-shadow);
  transition: top var(--t-fast);
}
.skip-link:focus { top: calc(12px + var(--safe-t)); }

/* Эффект выделения текста */
::selection { background: rgba(0, 194, 212, 0.34); color: #ffffff; text-shadow: none; }
::-moz-selection { background: rgba(0, 194, 212, 0.34); color: #ffffff; text-shadow: none; }

/* ============================================================
   ФОН: фиксированный слой с фото + скрим + эффекты
   ============================================================ */

.bg {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  overflow: hidden;
  background-color: #06121f;
}

/* blur-up плейсхолдер: крошечная размытая версия, видна мгновенно */
.bg__blur {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center;
  filter: blur(24px) saturate(1.1);
  transform: scale(1.06);
  transition: opacity 0.6s ease;
}
.bg__pic, .bg__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.bg__img {
  object-fit: cover;
  object-position: 50% 32%;      /* показываем светлую поверхность воды — сцена читается как вода */
  opacity: 0;
  transition: opacity 0.7s ease;
  will-change: transform;
}
.bg__blur { background-position: 50% 32%; }
.bg__img.is-loaded { opacity: 1; }
.bg.is-loaded .bg__blur { opacity: 0; }

/* светлый скрим: мягко поднимает яркость и держит читаемость */
.bg__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 6%, rgba(220, 240, 255, 0.26) 0%, rgba(220, 240, 255, 0) 52%),
    radial-gradient(90% 60% at 50% 120%, rgba(0, 40, 70, 0.0) 40%, rgba(2, 14, 26, 0.35) 100%),
    linear-gradient(180deg, rgba(6, 20, 36, 0.40) 0%, rgba(6, 20, 36, 0.04) 26%, rgba(6, 20, 36, 0.06) 62%, rgba(6, 20, 36, 0.34) 100%);
  pointer-events: none;
}

/* ============================================================
   Подводные эффекты (выключаются reduced-motion / при скрытой вкладке)
   ============================================================ */

.fx { position: absolute; inset: 0; pointer-events: none; }

.fx--caustics {
  background:
    radial-gradient(60% 40% at 30% 20%, rgba(120, 220, 240, 0.10), transparent 60%),
    radial-gradient(50% 35% at 75% 30%, rgba(80, 160, 240, 0.08), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.9;
  animation: caustics 18s ease-in-out infinite alternate;
}
@keyframes caustics {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.05); }
  100% { transform: translate3d(2%, 2%, 0) scale(1.12); }
}

.bubbles { position: absolute; inset: 0; overflow: hidden; }
.bubble {
  position: absolute;
  bottom: -40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.55), rgba(180,225,240,0.12) 60%, transparent 70%);
  box-shadow: inset 0 0 6px rgba(255,255,255,0.4);
  animation: rise linear infinite;
  opacity: 0;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(-108vh) translateX(20px); opacity: 0; }
}

/* приостановка анимаций, когда вкладка неактивна */
.is-hidden .fx--caustics,
.is-hidden .bubble,
.is-hidden .title,
.is-hidden .hero__fish,
.is-hidden .dropzone__badge::after { animation-play-state: paused; }

/* ============================================================
   Стеклянные поверхности
   ============================================================ */

.glass {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--r-lg);
}

/* fallback: нет backdrop-filter или слабое устройство → плотная заливка без блюра */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass, .chip { background: var(--glass-fill-strong); }
}
body.no-blur .glass,
body.no-blur .chip,
body.no-blur .home-link {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
body.no-blur .glass { background: var(--glass-fill-strong); }
body.no-blur .chip,
body.no-blur .home-link { background: var(--chip-fill); }

/* ============================================================
   Шапка с логотипами (тёмные лого на белой плашке)
   ============================================================ */

/* Полноэкранный каркас: шапка + контент + футер укладываются в один экран */
.shell {
  position: relative;
  z-index: var(--z-content);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: relative;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(16px + var(--safe-t)) calc(22px + var(--safe-r)) 0 calc(22px + var(--safe-l));
}
.topbar__spacer { flex: 0 0 auto; }

/* Общая «стеклянная» плашка шапки/навигации (chip с логотипами и ссылка «На главную») */
.chip, .home-link {
  background: var(--chip-fill);
  -webkit-backdrop-filter: var(--chip-blur);
  backdrop-filter: var(--chip-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  box-shadow: var(--chip-shadow);
}

/* Ссылка возврата на главную */
.home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease;
}
.home-link:hover { transform: translateY(-1px); background: #fff; }
.home-link__arrow { font-size: 1.05em; line-height: 1; }
.chip {
  display: flex;
  align-items: center;
  margin-left: auto;            /* логотипы всегда у правого края */
  gap: clamp(12px, 2.4vw, 22px);
  padding: 10px clamp(14px, 2.4vw, 20px);
}
.chip__logo { height: clamp(30px, 5.2vw, 46px); width: auto; }
.chip__sep { width: 1px; align-self: stretch; background: rgba(10, 37, 64, 0.14); }

/* ============================================================
   Каркас страницы
   ============================================================ */

.page {
  position: relative;
  z-index: var(--z-content);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2.5vw, 28px) clamp(18px, 5vw, 48px);
  text-align: center;
  width: 100%;
  min-width: 0;
}
/* на странице диагностики контент выравниваем по верху (карточки растут вниз) */
.page--diag { justify-content: flex-start; }
.page > * { max-width: 100%; min-width: 0; }

.title {
  margin: clamp(2px, 1.2vw, 14px) 0 0;
  font-weight: 800;
  font-size: clamp(1.6rem, 6.6vw, 5rem);
  letter-spacing: 0.015em;
  line-height: 1.04;
  /* градиентная заливка «бело-бирюзовая» с бегущим бликом + мягкое свечение */
  background: linear-gradient(100deg, #ffffff 0%, #dcf6ff 26%, #6fdcf3 43%, #dcf6ff 60%, #ffffff 100%);
  background-size: 220% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 16px rgba(3, 18, 33, 0.72)) drop-shadow(0 1px 2px rgba(3, 18, 33, 0.6));
  max-width: 100%;
  overflow-wrap: anywhere;   /* на очень узких экранах переносит, а не выходит за вьюпорт */
}
@keyframes titleShimmer { 0% { background-position: 120% 50%; } 100% { background-position: -120% 50%; } }
@keyframes titleGlow {
  0%, 100% { filter: drop-shadow(0 3px 16px rgba(3, 18, 33, 0.72)) drop-shadow(0 0 6px rgba(120, 225, 245, 0.0)); }
  50%      { filter: drop-shadow(0 3px 16px rgba(3, 18, 33, 0.72)) drop-shadow(0 0 18px rgba(120, 225, 245, 0.55)); }
}
/* акцентная линия под заголовком главной */
.page--home .title::after {
  content: '';
  display: block;
  width: clamp(64px, 12vw, 92px);
  height: 4px;
  margin: clamp(10px, 1.4vw, 16px) auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-blue));
  box-shadow: 0 4px 16px rgba(0, 180, 220, 0.5);
}
.subtitle {
  margin: clamp(8px, 1.4vw, 14px) auto 0;
  max-width: 56ch;
  font-weight: 500;
  font-size: clamp(0.98rem, 1.9vw, 1.28rem);
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 10px rgba(3, 18, 33, 0.75);
}
.subtitle--caps { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* ============================================================
   Кнопки
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 30px;
  font-family: inherit;
  font-weight: 600;
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  color: #fff;
  background: var(--btn-grad);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 14px 34px -10px rgba(0, 150, 200, 0.7), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--btn-grad-hover); transform: translateY(-2px); box-shadow: 0 20px 40px -10px rgba(0, 160, 210, 0.8), inset 0 1px 0 rgba(255,255,255,0.4); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; pointer-events: none; }
.btn__icon { font-size: 0.85em; line-height: 1; }
.btn--ghost {
  color: var(--ink);
  background: var(--glass-fill-strong);
  box-shadow: 0 8px 22px -8px rgba(5,22,40,0.4);
}
.btn--ghost:hover { background: #fff; }
.btn--lg { min-height: 60px; padding: 16px 40px; font-size: clamp(1.05rem, 2vw, 1.3rem); }

/* ============================================================
   Главная: hero-рыба
   ============================================================ */

.hero { display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; max-width: 100%; }
.hero > * { min-width: 0; max-width: 100%; }
.hero__fish {
  position: relative;
  margin: clamp(4px, 1.4vw, 16px) auto clamp(12px, 2vw, 20px);
  animation: float 7s ease-in-out infinite;
  display: flex;
  justify-content: center;
}
/* мягкое подводное свечение под рыбой */
.hero__fish::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -6%;
  width: 64%; height: 26%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 200, 230, 0.28), rgba(0, 200, 230, 0) 70%);
  filter: blur(8px);
  z-index: -1;
  pointer-events: none;
}
.hero__fish svg,
.hero__fish img,
.hero__fish picture { display: block; }
.hero__fish img {
  width: auto;
  height: auto;
  max-width: min(500px, 74vw);
  max-height: 28svh;        /* всё содержимое главной помещается в один экран ноутбука */
  object-fit: contain;
  filter:
    drop-shadow(0 22px 30px rgba(0, 18, 36, 0.6))
    drop-shadow(0 6px 14px rgba(0, 180, 220, 0.28));
  transition: transform 0.4s cubic-bezier(.2, .7, .2, 1), filter 0.4s ease;
}
/* эффект при наведении на рыбу: приближается и ярче «светится» */
@media (hover: hover) and (pointer: fine) {
  .hero__fish { cursor: url("/assets/images/cursor-pointer.svg") 16 16, pointer; }
  .hero__fish:hover img {
    transform: scale(1.06) rotate(-1.2deg);
    filter:
      drop-shadow(0 28px 38px rgba(0, 18, 36, 0.66))
      drop-shadow(0 10px 24px rgba(0, 200, 230, 0.55))
      saturate(1.08) brightness(1.04);
  }
  .hero__fish:hover::after {
    width: 72%;
    background: radial-gradient(ellipse at center, rgba(0, 210, 240, 0.42), rgba(0, 210, 240, 0) 70%);
  }
}
.hero__fish::after { transition: width 0.4s ease, background 0.4s ease; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-0.6deg); }
  50%      { transform: translateY(-14px) rotate(0.6deg); }
}

/* ============================================================
   Подвал: благодарность фонду
   ============================================================ */

.funding {
  position: relative;
  z-index: var(--z-content);
  flex: 0 0 auto;
  max-width: 920px;
  margin: 0 auto;
  padding: 8px clamp(18px, 5vw, 40px) calc(12px + var(--safe-b));
  font-size: clamp(0.68rem, 1.2vw, 0.8rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 8px rgba(3, 18, 33, 0.8);
  text-align: center;
}

/* ============================================================
   Диагностика: карточки загрузки и результата
   ============================================================ */

.diag { width: 100%; max-width: 760px; margin: clamp(14px, 3vw, 30px) auto 0; }

.card { padding: clamp(20px, 3.5vw, 34px); color: var(--ink); }
.card + .card { margin-top: clamp(16px, 2.5vw, 24px); }

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(28px, 5vw, 48px) clamp(20px, 4vw, 40px);
  border: 1.5px dashed rgba(47, 134, 235, 0.45);
  border-radius: 22px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(0, 194, 212, 0.10), rgba(255, 255, 255, 0) 62%),
    rgba(255, 255, 255, 0.46);
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  text-align: center;
  overflow: hidden;
}
.dropzone:hover {
  border-color: var(--accent-blue);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(0, 194, 212, 0.16), rgba(255, 255, 255, 0) 62%),
    rgba(236, 247, 255, 0.6);
  box-shadow: 0 16px 42px -18px rgba(0, 120, 180, 0.55);
}
.dropzone.is-drag {
  border-color: var(--accent-teal);
  border-style: solid;
  transform: scale(1.015);
  background: rgba(224, 245, 252, 0.72);
  box-shadow: 0 20px 54px -18px rgba(0, 180, 210, 0.6);
}

.dropzone__badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 194, 212, 0.20), rgba(47, 134, 235, 0.20));
  border: 1px solid rgba(47, 134, 235, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 12px 26px -12px rgba(0, 120, 180, 0.5);
  transition: transform 0.3s ease;
}
.dropzone__badge::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(0, 194, 212, 0.35);
  animation: pulseRing 2.4s ease-out infinite;
}
@keyframes pulseRing {
  0% { transform: scale(0.92); opacity: 0.8; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { opacity: 0; }
}
.dropzone:hover .dropzone__badge { transform: translateY(-3px) scale(1.05); }
.dropzone__icon { width: 36px; height: 36px; color: var(--accent-blue); }
.dropzone__title { font-weight: 700; font-size: clamp(1.02rem, 2.2vw, 1.18rem); color: var(--ink); }
.dropzone__title u { text-decoration-color: var(--accent-blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.dropzone__hint { font-size: 0.86rem; color: var(--ink-faint); letter-spacing: 0.01em; }

.diag__head { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 14px; }
.diag__example { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.diag__example svg { width: 96px; height: auto; opacity: 0.9; }
.diag__example span { font-size: 0.78rem; color: var(--ink-faint); }

.preview { display: none; flex-direction: column; align-items: center; gap: 16px; }
.preview.is-shown { display: flex; }
.preview__img { max-height: 320px; width: auto; border-radius: var(--r-sm); box-shadow: var(--glass-shadow); }
.preview__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.diag__cta { display: flex; justify-content: center; margin-top: clamp(16px, 2.5vw, 22px); }

/* состояние загрузки */
.loading { display: none; flex-direction: column; align-items: center; gap: 16px; padding: clamp(24px, 4vw, 40px); text-align: center; }
.loading.is-shown { display: flex; }
.loading__text { font-weight: 600; color: var(--ink); }
.spinner {
  width: 64px; height: 64px; border-radius: 50%;
  border: 5px solid rgba(47, 134, 235, 0.22);
  border-top-color: var(--accent-teal);
  border-right-color: var(--accent-blue);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* карточка результата */
.result { display: none; }
.result.is-shown { display: block; animation: reveal 0.5s ease both; }
.result__inner { display: flex; gap: clamp(16px, 3vw, 26px); align-items: flex-start; }
.result__thumb { flex: 0 0 auto; width: clamp(96px, 28vw, 160px); border-radius: var(--r-sm); box-shadow: var(--glass-shadow); }
.result__body { flex: 1 1 auto; text-align: left; min-width: 0; }
.result__species { margin: 0 0 4px; font-weight: 700; font-size: clamp(1.15rem, 2.6vw, 1.5rem); color: var(--ink); }
.result__lat { margin: 0 0 12px; font-style: italic; color: var(--ink-soft); }
.result__text { margin: 0; color: var(--ink-soft); }
.result__badge {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 14px; padding: 6px 14px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600;
}
.result__badge::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.badge--high { background: rgba(16, 160, 110, 0.14); color: #0a7a52; }
.badge--medium { background: rgba(214, 158, 24, 0.16); color: #9a6a05; }
.badge--low { background: rgba(214, 90, 50, 0.16); color: #b04522; }
.result__caveat { margin: 12px 0 0; font-size: 0.9rem; color: var(--ink-faint); }

/* блок ошибки / «не рыба» */
.notice { display: none; text-align: center; }
.notice.is-shown { display: block; animation: reveal 0.4s ease both; }
.notice__icon { width: 52px; height: 52px; margin: 0 auto 12px; color: var(--accent-blue); }
.notice__text { margin: 0; color: var(--ink-soft); font-weight: 500; }

@keyframes reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* визуально скрытый, но доступный скринридерам */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* плавный переход между страницами */
.page-leave { animation: fadeOut 0.32s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: scale(0.99); } }

/* ============================================================
   Современные штрихи: появление контента + блик кнопки
   ============================================================ */
.btn { position: relative; overflow: hidden; }
.btn > span { position: relative; z-index: 1; }
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-18deg);
  z-index: 0;
}
.btn:hover::after { animation: shine 0.75s ease; }
@keyframes shine { from { left: -60%; } to { left: 130%; } }

@keyframes revealUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes revealFade { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  .title {
    animation:
      revealUp 0.7s 0.05s both cubic-bezier(.2, .7, .2, 1),
      titleShimmer 7s linear 1s infinite,
      titleGlow 4.5s ease-in-out 1.2s infinite;
  }
  .subtitle { animation: revealUp 0.7s 0.16s both cubic-bezier(.2, .7, .2, 1); }
  .page--home .hero__fish { animation: float 7s ease-in-out infinite, revealFade 0.9s 0.26s both; }
  .page--home .btn { animation: revealUp 0.7s 0.40s both cubic-bezier(.2, .7, .2, 1); }
  .diag .card:first-child { animation: revealUp 0.7s 0.22s both cubic-bezier(.2, .7, .2, 1); }
}

/* ============================================================
   Адаптив
   ============================================================ */

@media (max-width: 560px) {
  /* topbar остаётся space-between: «На главную» слева, логотипы справа */
  .home-link { padding: 8px 12px; font-size: 0.84rem; }
  .chip { gap: 10px; padding: 8px 12px; }
  .chip__logo { height: 26px; }
  .btn { width: 100%; }
  /* компактнее, чтобы главная помещалась в один экран телефона */
  .subtitle { font-size: clamp(0.84rem, 3.6vw, 1rem); }
  .hero__fish img { max-height: 24svh; }
  .funding { font-size: 0.62rem; line-height: 1.4; padding-top: 4px; }
  .result__inner { flex-direction: column; align-items: center; }
  .result__body { text-align: center; }
  .result__thumb { width: clamp(140px, 60vw, 220px); }
  .diag__head { flex-direction: column; }
}

/* меньше эффектов на мобильных */
@media (max-width: 768px) {
  .bubble:nth-child(n+7) { display: none; }
}

/* полное отключение анимаций по запросу пользователя */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero__fish, .fx--caustics, .bubbles { animation: none !important; }
  .bubbles { display: none; }
}

/* усиление контраста по запросу пользователя (WCAG, prefers-contrast) */
@media (prefers-contrast: more) {
  .bg__scrim {
    background: linear-gradient(180deg, rgba(6, 20, 36, 0.62) 0%, rgba(6, 20, 36, 0.5) 100%);
  }
  .title, .subtitle, .funding { text-shadow: 0 1px 2px #000, 0 2px 12px #000; }
  .glass, .chip, .home-link { border-color: rgba(10, 37, 64, 0.55); }
  .dropzone { border-color: var(--accent-blue); }
}
