/* ===== Шрифты =====
   Оба лежат у нас в /public/fonts, а не тянутся с чужого CDN — значит буквы
   одинаковые в Windows, macOS, iOS и Android.

   Inter — один переменный файл на 47 КБ, внутри все толщины от 300 до 900.
   Отдельными файлами это было бы 12 штук: на сайте используются и 650, и 760,
   и 850. Без переменного файла браузер такие толщины подделывает, раздувая
   контур, и жирность выглядит грязно.

   font-display: optional — самое важное. Браузер даёт шрифту 100 мс: успел —
   рисует им, не успел — эта загрузка страницы целиком идёт системным шрифтом,
   а файл кладётся в кэш и работает со следующего захода. Подмены на лету не
   бывает никогда, поэтому текст не дёргается и вёрстка не прыгает. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 900;
  font-display: optional;
  src: url('/fonts/inter-var-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url('/fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: optional;
  src: url('/fonts/ibm-plex-mono-600-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url('/fonts/ibm-plex-mono-700-latin.woff2') format('woff2');
}

* {
  box-sizing: border-box;
}

:root {
  /* Единственное место, где задан шрифт сайта. Во всех остальных файлах
     стоит var(--font-ui) или var(--font-mono) — руками шрифт больше нигде
     не пишем, иначе снова разъедется. */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Roboto Mono', monospace;

  --bg: #ffffff;
  --surface: #ffffff;
  --text: #020817;
  --muted: #64708a;
  --line: #edf0f5;
  --navy: #020817;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  /* На главной подключён palette-legacy.css (ради окна редактора цвета), а он
     задаёт body свою межстрочную 1.6. Здесь она возвращается к обычной: на
     остальных страницах это ничего не меняет, там она и так обычная. */
  line-height: normal;
}

/* Браузер не наследует шрифт для полей и кнопок — без этой строки они
   рисуются его собственным дефолтом (Arial), и кнопки выпадают из вида
   всей остальной страницы. */
button,
input,
select,
textarea {
  font-family: inherit;
}

/* Синяя рамка, остающаяся вокруг кнопки после нажатия. Браузер после клика
   или тапа оставляет на кнопке фокус и рисует вокруг неё системную обводку —
   на телефоне это видно лучше всего: закрыл меню крестиком, а рамка вокруг
   него осталась висеть. Убираем её ТОЛЬКО для мыши и пальца: `:focus-visible`
   браузер ставит сам и только тогда, когда по странице идут с клавиатуры —
   там обводка нужна, иначе человек не видит, на чём он стоит. Поэтому
   отключать `outline` целиком нельзя, гасим лишь случай «фокус есть, а
   показывать его незачем». */
:focus:not(:focus-visible) {
  outline: none;
}

body.moodboard-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 0;
}

.site-header__inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Правый угол шапки: кнопка входа и бургер стоят рядом на всех экранах. */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.04em;
}

.site-logo__img {
  width: 96px;
  display: block;
}

.site-logo__text {
  font-size: 29px;
  line-height: 1;
}

/* ===== Меню во весь экран =====
   Оверлей начинается от верхнего края экрана. Логотип и крестик живут
   в собственной светло-жёлтой полосе меню. */

.site-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #fff0a8;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.site-menu.is-open {
  opacity: 1;
  visibility: visible;
}

/* Верхняя полоса совпадает с сеткой обычной шапки, но целиком принадлежит меню. */
.site-menu__bar {
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 82px;
  padding-inline: max(24px, calc((100vw - 1280px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff0a8;
  box-sizing: border-box;
}

.site-menu__logo {
  flex: 0 0 auto;
}

.site-menu__close {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.site-menu__close svg {
  width: 30px;
  height: 30px;
  display: block;
}

.site-menu__close path {
  fill: none;
  stroke: #020817;
  stroke-width: 3;
  stroke-linecap: round;
}

.site-menu__nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

/* Полосы лежат друг на друге, как цветные листы. Мягкий верхний радиус справа
   показывает цвет предыдущей полосы вместо острого диагонального угла. */
.menu-band {
  --menu-slant: 44px;
  --menu-notch: 66px;
  --menu-radius: 34px;
  position: relative;
  flex: 1 1 0;
  min-height: 96px;
  display: flex;
  align-items: center;
  margin-top: calc(var(--menu-slant) * -1);
  padding: 8px 0 calc(var(--menu-slant) + 8px);
  color: #020817;
  border-radius: 0 var(--menu-radius) 0 0;
  overflow: hidden;
}

/* Первая полоса ни на что не наезжает. */
.menu-band:first-child {
  margin-top: 0;
}

.menu-band[hidden] {
  display: none !important;
}

.menu-band:nth-child(1) { background: #f5c542; }
.menu-band:nth-child(2) { background: #f2865e; }
.menu-band:nth-child(3) { background: #e2686f; }
.menu-band:nth-child(4) { background: #b478d4; }
.menu-band:nth-child(5) { background: #6fa8e6; }
.menu-band:nth-child(6) { background: #57c7a3; }
.menu-band:nth-child(7) { background: #c6d95f; }
/* Восьмая полоса — My Account, видна только после входа. */
.menu-band:nth-child(8) { background: #ec8fc0; }

.menu-band__inner {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding-right: calc(var(--menu-notch) + 8px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 64px);
  box-sizing: border-box;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-band__num {
  display: block;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  opacity: 0.55;
}

.menu-band__title {
  display: block;
  justify-self: end;
  text-align: right;
  font-size: clamp(26px, 5.2vw, 58px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
}

.menu-band:hover .menu-band__inner,
.menu-band:focus-visible .menu-band__inner {
  transform: translateX(14px);
}

.menu-band:focus-visible {
  outline: 3px solid #020817;
  outline-offset: -6px;
}

/* Полосы въезжают слева по очереди. Задержка своя у каждой, иначе всё
   появляется одним куском и движение не читается. */
.site-menu .menu-band {
  opacity: 0;
  transform: translateX(-32px);
  transition:
    opacity 0.34s ease,
    transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-menu.is-open .menu-band {
  opacity: 1;
  transform: none;
}

.site-menu.is-open .menu-band:nth-child(1) { transition-delay: 0.04s; }
.site-menu.is-open .menu-band:nth-child(2) { transition-delay: 0.08s; }
.site-menu.is-open .menu-band:nth-child(3) { transition-delay: 0.12s; }
.site-menu.is-open .menu-band:nth-child(4) { transition-delay: 0.16s; }
.site-menu.is-open .menu-band:nth-child(5) { transition-delay: 0.20s; }
.site-menu.is-open .menu-band:nth-child(6) { transition-delay: 0.24s; }
.site-menu.is-open .menu-band:nth-child(7) { transition-delay: 0.28s; }
.site-menu.is-open .menu-band:nth-child(8) { transition-delay: 0.32s; }

/* Пока меню открыто, страница под ним не прокручивается. */
body.menu-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .site-menu,
  .site-menu .menu-band,
  .menu-band__inner {
    transition: none;
  }
}

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

.site-auth__login {
  font-size: 14px;
  font-weight: 600;
  color: #1d2840;
}

.site-auth__signup,
.site-auth__account {
  width: 165px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 26px;
  border-radius: 14px;
  background: var(--navy);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(2, 8, 23, 0.16);
}

.site-auth__login[hidden],
.site-auth__signup[hidden],
.site-auth__account[hidden] {
  display: none !important;
}

.site-menu-toggle {
  display: inline-flex;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.hamburger input {
  display: none;
}

.hamburger svg {
  height: 34px;
  width: 34px;
  display: block;
  transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger .line {
  fill: none;
  stroke: #020817;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  transition:
    stroke-dasharray 600ms cubic-bezier(0.4, 0, 0.2, 1),
    stroke-dashoffset 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger .line-top-bottom {
  stroke-dasharray: 12 63;
}

.site-header.menu-open .hamburger svg {
  transform: rotate(-45deg);
}

.site-header.menu-open .hamburger .line-top-bottom {
  stroke-dasharray: 20 300;
  stroke-dashoffset: -32.42;
}

.page-content {
  padding: 72px 0 100px;
}

.page-content h1 {
  margin: 0 0 16px;
  font-size: 56px;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.page-content p {
  margin: 0;
  font-size: 20px;
  line-height: 1.6;
  color: var(--muted);
}

.site-footer {
  background: #ffffff;
  border-top: 0;
}

.site-footer__inner {
  padding: 32px 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-footer__copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  color: #7a87a3;
}

.site-footer__copy span[aria-hidden="true"] {
  margin: 0 14px;
  color: #8b7cff;
}

.site-footer__heart {
  display: inline-block;
  margin: 0 4px !important;
  background: linear-gradient(135deg, #8b5cf6 0%, #ff4db8 55%, #ff8a5c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transform: translateY(1px);
}

.site-footer__links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.site-footer__links a {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid #e7eaf3;
  border-radius: 999px;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5d6785;
  font-size: 14px;
  line-height: 1;
  font-weight: 300;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.site-footer__links a:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.site-footer__links a:active {
  transform: scale(0.98);
  background: #f5f6fb;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.05);
}

.moodboard-page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (max-width: 1080px) {
  .site-header {
    top: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(237, 240, 245, 0.9);
  }

  .site-header__inner {
    position: relative;
    min-height: 74px;
    grid-template-columns: auto auto;
    justify-content: space-between;
    gap: 16px;
  }

  .site-logo__img {
    width: 96px;
  }

  .site-logo__text {
    font-size: 26px;
  }

  .site-menu__bar {
    min-height: 74px;
  }

  .menu-band {
    --menu-slant: 34px;
    --menu-notch: 46px;
    --menu-radius: 28px;
  }

  .site-auth__signup,
  .site-auth__account {
    width: auto;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 13px;
  }

  .page-content {
    padding: 48px 0 72px;
  }

  .page-content h1 {
    font-size: 40px;
  }

  .page-content p {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .site-menu__bar {
    padding-inline: 16px;
  }

  .menu-band {
    --menu-slant: 26px;
    --menu-notch: 34px;
    --menu-radius: 22px;
  }

  .menu-band__inner {
    width: calc(100% - 32px);
    padding-right: calc(var(--menu-notch) + 4px);
    gap: 12px;
  }

  .menu-band__title {
    font-size: clamp(21px, 7vw, 30px);
  }

  .site-auth__signup,
  .site-auth__account {
    padding: 0 14px;
    font-size: 12px;
  }
}

.hero {
  padding: 120px 0 80px;
}

.hero h1 {
  font-size: 64px;
  line-height: 0.95;
  margin: 0 0 20px;
  letter-spacing: -0.04em;
}

.hero p {
  font-size: 22px;
  color: var(--muted);
  max-width: 600px;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 15px;
  text-decoration: none;
}

.btn-primary {
  background: #020817;
  color: #fff;
}

.btn-secondary {
  background: #eee;
  color: #111;
}

/* Knopka Log in na /account: chjornaja, pri navedenii sinjaja */
.btn-dark {
  background: #020817;
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-dark:hover {
  background: #2663eb;
}

.btn-dark:active {
  transform: scale(0.98);
}

/* Krasnaja knopka: Delete account. Cvet otlichaet ejo ot chjornogo Log out. */
.btn-danger {
  background: #d92d20;
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-danger:hover {
  background: #b42318;
}

.btn-danger:active {
  transform: scale(0.98);
}

/* Knopka Create account na /account: raduga kak u Generate Palette */
.btn-rainbow-alt {
  --rainbow-gradient: linear-gradient(110deg, #FF8C00 0%, #FF5B2E 20%, #FF2F86 42%, #9B42FF 62%, #2563EB 82%, #16C7E8 100%);
  --hero-primary-dance-width: 260px;
  --hero-primary-dance-timing: 2s;

  position: relative;
  color: #ffffff;
  background: var(--rainbow-gradient);
  border: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  font-weight: 600;
  transition: transform 0.2s ease;

  /* srazu - bezhashchaja raduga */
  background-image: linear-gradient(
    to right,
    #FF8C00,
    #FF8C00 16.65%,
    #FF5B2E 16.65%,
    #FF5B2E 33.3%,
    #FF2F86 33.3%,
    #FF2F86 49.95%,
    #9B42FF 49.95%,
    #9B42FF 66.6%,
    #2563EB 66.6%,
    #2563EB 83.25%,
    #16C7E8 83.25%,
    #16C7E8 100%,
    #FF8C00 100%
  );
  background-size: var(--hero-primary-dance-width) 100%;
  animation: heroPrimaryDance var(--hero-primary-dance-timing) linear infinite;
}

.btn-rainbow-alt:hover {
  background-image: var(--rainbow-gradient);
  background-size: 100% 100%;
  animation: none;
}

.btn-rainbow-alt:active {
  transform: scale(0.98);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 100px;
}

.feature {
  background: #fff;
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 12px;
}

.feature h3 {
  margin: 0 0 10px;
}

.feature p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .features {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 44px;
  }
}

.saved-palettes-header {
  margin-bottom: 32px;
}

.saved-palettes-header p {
  color: var(--muted);
  margin-top: 8px;
}

.saved-palettes-list {
  display: grid;
  gap: 20px;
}

.saved-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}

.saved-card__top {
  margin-bottom: 18px;
}

.saved-card__meta {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.saved-card__heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Open i Delete vsegda na odnoj stroke; nazvanie s poloskoj
   perenosjatsja vnutri srednego bloka mezhdu nimi. */
.saved-card__heading-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.saved-card__open,
.saved-card__delete {
  flex: 0 0 auto;
}

/* Uzkie ekrany: Open i Delete ostajutsja v odnoj stroke (na odnoj vysote),
   a nazvanie s poloskoj perenosjatsja pod nih na vsju shirinu. */
@media (max-width: 560px) {
  .saved-card__heading {
    flex-wrap: wrap;
  }

  .saved-card__delete {
    order: 2;
  }

  .saved-card__heading-main {
    order: 3;
    flex-basis: 100%;
    min-width: 100%;
  }
}

/* Knopka "Open" - otkryvaet palitru v generatore */
.saved-card__open {
  height: 34px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.saved-card__open:hover {
  background: #f4f5f7;
}

.saved-card__title {
  margin: 0;
  font-size: 24px;
}

/* Kompaktnaja poloska palitry rjadom s nazvaniem - kak v istorii na /palette */
.saved-card__strip {
  display: flex;
  align-items: stretch;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
}

.saved-card__strip-swatch {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.saved-card__gradient {
  height: 120px;
  border-radius: 12px;
  margin-bottom: 18px;
  background: #f4f4f4;
}

@media (max-width: 560px) {
  .saved-card__gradient {
    height: 96px;
  }
}

/* Knopki skachivanija pod palitroj. Vid kak v generatore (Download palette),
   no primerno v 1.5 raza melche. */
.saved-card__download {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.saved-card__dl-btn {
  height: 32px;
  min-width: 68px;
  padding: 0 14px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.saved-card__dl-btn:hover {
  background: #f4f5f7;
}

.saved-card__dl-btn:active {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #e3e3e3;
}

.saved-card__dl-icon {
  width: 11px;
  height: 11px;
  display: block;
  flex: 0 0 auto;
}

.saved-card__delete {
  margin-left: auto;
  height: 34px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.saved-card__delete:hover {
  background: #e5484d;
  border-color: #e5484d;
  color: #ffffff;
}

.saved-card__swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.saved-swatch {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fafafa;
}

.saved-swatch__color {
  height: 72px;
}

.saved-swatch__hex,
.saved-swatch__name {
  padding: 8px 10px;
  font-size: 12px;
}

.saved-swatch__hex {
  font-weight: 700;
}

.saved-swatch__name {
  color: var(--muted);
  padding-top: 0;
  padding-bottom: 10px;
}

/* Seraja oblast kubika (kod + nazvanie) - klik kopiruet HEX */
.saved-swatch__info {
  cursor: pointer;
  transition: background 0.15s ease;
}

.saved-swatch__info:hover {
  background: #f0f0f0;
}

/* Vsplyvajuschee soobschenie "Copied: ..." - kak na generatore */
.fc-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.fc-toast.show {
  opacity: 1;
}

.saved-empty {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
}

.saved-empty h2 {
  margin-top: 0;
}


/* ============================================================
   MOODBOARD
   ============================================================ */

:root{
  --gap: 10px;
  --outer: 10px;
  --mb-rail-w: 25px;
}

/* ---- Page shell: header + centered start screen + footer, one viewport ---- */
body.moodboard-shell{
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.moodboard-page{
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ---- Start screen (before a folder is chosen) --------------------------
   Same building blocks as the "palette from image" start screen:
   .pfi-start > .pfi-start-inner > (header, button, hint, note).           */
.pfi-start{
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 16px;
}

.pfi-start-inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  /* Reserve a consistent block height so the heading sits at the same
     vertical position as the /palette-from-image start screen, regardless
     of how many lines the hint text below wraps to. */
  min-height: 290px;
}

.pfi-start .moodboard-header{
  margin-bottom: 14px;
}

.pfi-start-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(0,0,0,0.18);
  background: #ffffff;
  padding: 14px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  color: #1a1a1a;
  box-shadow: 0 14px 40px rgba(0,0,0,0.10);
  transition: transform 0.15s ease;
}

.pfi-start-btn:active{
  transform: translateY(1px);
}

.pfi-start-btn__icon{
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pfi-start-hint{
  max-width: min(560px, calc(100vw - 40px));
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.2px;
  color: #888888;
  padding-top: 20px;
  margin: 0;
}

.pfi-start-note{
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(0,0,0,0.45);
  margin: 24px 0 0;
}

.hidden{
  display: none !important;
}

/* ---- Board (built while hidden, shown only in fullscreen mode) ---- */
#board{
  display: none;
  box-sizing: border-box;
  padding: var(--outer);
  flex-direction: column;
  gap: var(--gap);
  overflow: hidden;
}

.row{
  display: flex;
  gap: var(--gap);
  width: 100%;
  align-items: stretch;
  justify-content: center;
}

.item{
  overflow: hidden;
  border-radius: 10px;
  background: transparent;
  flex: 0 0 auto;
  cursor: grab;
  transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease;
}

.item.dragging{
  opacity: .35;
  transform: scale(.97);
  cursor: grabbing;
}

.item.drag-over{
  box-shadow: 0 0 0 3px #6c47ff, 0 4px 24px rgba(108,71,255,.25);
  transform: scale(1.03);
}

.item img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---- Lightbox ---- */
#lightbox{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#lightbox.open{
  display: flex;
}

#lightboxInner{
  position: relative;
  max-width: min(92vw, 1400px);
  max-height: 90vh;
  border-radius: 14px;
  overflow: visible;
  box-shadow: none;
  background: transparent;
  transform: scale(0.98);
  opacity: 0;
  transition: transform .16s ease, opacity .16s ease;
}

#lightbox.open #lightboxInner{
  transform: scale(1);
  opacity: 1;
}

#lightboxContent{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  box-sizing: border-box;
}

#lightboxImg{
  display: block;
  width: 100%;
  height: 100%;
  max-width: min(92vw, 1400px);
  max-height: calc(90vh - 18px);
  object-fit: contain;
  background: transparent;
  border-radius: 4px;
}

#lightboxCaption{
  font-size: 11px;
  line-height: 1.2;
  color: rgb(255 255 255 / 44%);
  text-align: center;
  letter-spacing: 0.01em;
  user-select: none;
}

/* ---- Header block (shared with the palette-from-image start screen) ---- */
.moodboard-header{
  text-align: center;
  margin-bottom: 24px;
  background: transparent;
  border: 0;
}

.moodboard-header-title{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.moodboard-header-logo{
  height: 64px;
  max-height: 64px;
  width: auto;
  display: block;
  padding-bottom: 11px;
  flex-shrink: 0;
}

.moodboard-header-heading{
  font-family: var(--font-ui);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin: 0 0 10px;
  line-height: 1.1;
  background: linear-gradient(135deg, #110623 0%, #4a4a4a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.moodboard-header-subtitle{
  font-family: var(--font-ui);
  font-size: 18px;
  color: #666;
  font-weight: 400;
  letter-spacing: .2px;
  line-height: 1.2;
  margin: 0;
}

.usage-hint-icon{
  display: inline-block;
  vertical-align: -2px;
  margin-right: 5px;
  opacity: 0.75;
}

/* ============================================================
   MOODBOARD — responsive
   ============================================================ */
@media (max-width: 1024px) {
  :root {
    --gap: 8px;
    --outer: 8px;
  }

  .moodboard-header-heading {
    font-size: 38px;
    letter-spacing: -1px;
  }

  .moodboard-header-subtitle {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  :root {
    --gap: 6px;
    --outer: 12px;
  }

  .pfi-start {
    padding: 12px;
  }

  .pfi-start-inner {
    gap: 8px;
  }

  .pfi-start-hint {
    padding-top: 12px;
  }

  .pfi-start-note {
    margin-top: 16px;
  }

  .moodboard-header {
    margin-bottom: 20px;
    padding: 0 16px;
  }

  .moodboard-header-title {
    gap: 10px;
    flex-wrap: wrap;
  }

  .moodboard-header-logo {
    height: 48px;
  }

  .moodboard-header-heading {
    font-size: 32px;
    letter-spacing: -0.8px;
    margin: 0 0 8px;
  }

  .moodboard-header-subtitle {
    font-size: 15px;
  }

  .row {
    justify-content: stretch;
  }

  .item {
    background: rgba(255,255,255,0.72);
    box-shadow: 0 10px 24px rgba(17, 6, 35, 0.08);
    border-radius: 8px;
  }

  .item img {
    object-fit: cover;
  }

  /* Fullscreen board can scroll on phones when there are many rows */
  body.moodboard-fullscreen #board {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: max(var(--outer), env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    align-items: stretch;
    justify-content: flex-start;
    overscroll-behavior-y: contain;
  }

  #lightbox {
    padding: 16px;
  }

  #lightboxImg {
    max-height: calc(90vh - 14px);
  }
}

@media (max-width: 480px) {
  :root {
    --gap: 5px;
    --outer: 10px;
  }

  .moodboard-header {
    margin-bottom: 16px;
    padding: 0 12px;
  }

  .moodboard-header-title {
    flex-direction: column;
    gap: 8px;
  }

  .moodboard-header-logo {
    height: 40px;
  }

  .moodboard-header-heading {
    font-size: 26px;
    letter-spacing: -0.5px;
    margin: 0 0 6px;
    text-align: center;
  }

  .moodboard-header-subtitle {
    font-size: 14px;
    line-height: 1.4;
  }

  body.moodboard-fullscreen #board {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .item {
    border-radius: 12px;
  }

  #lightbox {
    padding: 12px;
  }

  #lightboxImg {
    max-height: calc(88vh - 14px);
  }

  #lightboxCaption {
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  :root {
    --gap: 4px;
    --outer: 8px;
  }

  .moodboard-header-logo {
    height: 34px;
  }

  .moodboard-header-heading {
    font-size: 22px;
    letter-spacing: -0.3px;
  }

  .moodboard-header-subtitle {
    font-size: 13px;
  }
}

/* ===== Moodboard fullscreen mode (after a folder is chosen) ===== */
body.moodboard-fullscreen {
  overflow: hidden;
}

body.moodboard-fullscreen .site-header,
body.moodboard-fullscreen .site-footer,
body.moodboard-fullscreen .pfi-start {
  display: none;
}

body.moodboard-fullscreen #board {
  display: flex;
  height: 100vh;
  min-height: 100vh;
  padding-top: var(--outer);
  padding-bottom: var(--outer);
}

.account-page {
  display: grid;
  gap: 28px;
}

.account-page.is-loading #authView,
.account-page.is-loading #accountView {
  display: none !important;
}

.account-page:not(.is-loading) .account-loading {
  display: none;
}

.account-loading {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--muted);
  font-size: 15px;
}

.account-heading p {
  margin-top: 10px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.account-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}

.account-card h2 {
  margin: 0 0 18px;
  font-size: 24px;
}

.account-form {
  display: grid;
  gap: 16px;
}

.account-label {
  display: grid;
  gap: 8px;
}

.account-label span {
  font-size: 14px;
  color: var(--muted);
}

.account-label input {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
  background: #fff;
}

.account-message {
  min-height: 20px;
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* Blok nastroek v kabinete: kazhdyj otdeljon odnoj verhnej liniej.
   Pervyj blok bez linii. Tak ubrali dvojnuju razdelitelnuju liniju. */
.account-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.account-section:first-of-type {
  border-top: none;
  padding-top: 4px;
}

.account-section > h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

/* Kabinet: setka 2 kolonki x 2 stroki.
   Sleva - tekst/tumbler, sprava - knopka. row-gap zadajot rasstojanie
   mezhdu strokami nadjozhno (ne zavisit ot display bloka). */
.account-dash-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 22px;
}

/* Knopki Log out / Delete account: prizhaty vpravo.
   font-family: inherit - chtoby shrift knopok sovpadal s tekstom
   "Email:" i "Change password" (u <button> po umolchaniju svoj Arial). */
.account-dash-grid > .btn {
  justify-self: end;
  font-family: inherit;
}

/* Pochta odnoj strokoj. Razmer i shrift kak u knopok (.btn: 15px). */
.account-line {
  font-size: 15px;
}

.account-line__label {
  font-weight: 600;
}

.account-line__value {
  font-weight: 400;
  word-break: break-word;
}

/* Blok "vvedite kod dlja udalenija": pojavljaetsja pod krasnoj knopkoj */
.account-delete-confirm {
  width: 100%;
  max-width: 420px;
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.account-delete-actions {
  display: flex;
  gap: 12px;
}

.account-delete-actions .btn {
  flex: 1;
}

/* Ssylka "Forgot password?" pod formoj logina */
.account-link {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  margin-top: 14px;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.account-link:hover {
  color: #2663eb;
}

.account-subform {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Forma smeny parolja: pojavljaetsja pod tumblerom, otdeljona liniej */
.account-password {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.account-password .account-form {
  max-width: 420px;
}

.account-hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.account-hint.is-ok {
  color: #067647;
}

.account-hint.is-error {
  color: #b42318;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

/* Tumbler "Sign out other devices": vykljuchen - seryj, vkljuchen - zeljonyj.
   Forma takaja zhe, kak u tumblera blokirovki fona na /palette,
   no cveta svoi, poetomu i klassy otdelnye. */
.account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

/* Zagolovok "Change password" - razmer i shrift kak u knopok */
.account-toggle__text {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.account-switch {
  display: inline-block;
  position: relative;
  width: 45px;
  height: 22px;
  flex: 0 0 auto;
}

.account-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.account-switch__slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background-color: #d0d5dd;
  border-radius: 34px;
  transition: background-color 0.3s ease;
}

.account-switch input:checked + .account-switch__slider {
  background-color: #4bc05f;
}

.account-switch__knob {
  position: absolute;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  pointer-events: none;
}

.account-switch input:checked ~ .account-switch__knob {
  transform: translateX(23px) translateY(-50%);
}

@media (max-width: 900px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

/* Uzkie ekrany: setka stanovitsja odnoj kolonkoj po centru */
@media (max-width: 600px) {
  .account-dash-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 16px;
    text-align: center;
  }

  .account-dash-grid > .btn {
    justify-self: center;
  }

  .account-toggle {
    justify-content: center;
  }
}


/* ===== Auth save modal ===== */

.auth-save-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-save-modal.show {
  display: flex;
}

.auth-save-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
}

.auth-save-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.auth-save-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.auth-save-modal h2,
.auth-save-modal h3 {
  margin: 0;
}

.auth-save-modal__text {
  margin: 12px 0 20px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-save-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  background: #f2f2f2;
  border-radius: 16px;
}

.auth-save-tab {
  border: 0;
  border-radius: 12px;
  padding: 12px;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}

.auth-save-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.auth-save-form {
  display: grid;
  gap: 14px;
}

.auth-save-form label {
  display: grid;
  gap: 8px;
}

.auth-save-form span {
  color: var(--muted);
  font-size: 14px;
}

.auth-save-form input {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
}

.auth-save-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-save-success {
  padding-top: 8px;
}

.auth-save-success p {
  color: var(--muted);
}

.auth-save-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Knopki v okne "Save this palette to your account" (Log in and save,
   Create account, Go to My palettes). Na stranicah generatora .btn-primary
   pereopredeljon na zeljonyj - vozvraschaem fon #020817 i belyj tekst,
   kak u knopki Log in na /account. */
.auth-save-modal .btn-primary {
  background: #020817;
  color: #ffffff;
  font-weight: 600;
}

.auth-save-modal .btn-primary:hover {
  background: #2663eb;
}

/* ============================================================
   HOME HERO
   ============================================================ */

.home-page {
  overflow: hidden;
}

.home-hero {
  position: relative;
  padding: 34px 0 72px;
  background: #ffffff;
}

.home-hero__inner {
  width: min(1280px, calc(100% - 48px));
  display: grid;
  grid-template-columns: minmax(650px, 1.05fr) minmax(470px, 0.95fr);
  align-items: center;
  gap: 18px;
}

.home-hero__content {
  padding-top: 12px;
}

.home-hero__title {
  margin: 0;
  display: flex;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  letter-spacing: -0.06em;
  white-space: nowrap;
  width: max-content;
  max-width: 100%;
}

.home-hero__find {
  font-size: clamp(120px, 10.5vw, 168px);
  line-height: 0.88;
  font-weight: 800;
  color: #020617;
}

.home-hero__color-word {
  display: block;
  width: clamp(420px, 43vw, 680px);
  max-width: none;
  height: auto;
  transform: translateY(12px) rotate(356deg);
}

.home-hero__text {
  margin: 56px 0 0;
  max-width: 620px;
  font-size: 21px;
  line-height: 1.6;
  color: #64748b;
  letter-spacing: -0.02em;
}

.home-hero__text.home-hero__text--after {
  margin-top: 28px;
}

.home-hero__h1 {
  margin: 22px 0 0;
  max-width: 620px;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.25;
  font-weight: 700;
  color: #020617;
  letter-spacing: -0.03em;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 38px;
}

.hero-btn {
  min-height: 64px;
  padding: 0 24px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 18px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-btn:hover {
  transform: translateY(-2px);
}

.hero-btn__icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: block;
}

.hero-btn--secondary .hero-btn__icon {
  transform: rotate(90deg);
}

.hero-btn__arrow {
  width: 20px;
  height: 20px;
  margin-left: 2px;
  flex: 0 0 auto;
}


.hero-btn--primary {
  --hero-primary-gradient: linear-gradient(110deg, #FF8C00 0%, #FF5B2E 20%, #FF2F86 42%, #9B42FF 62%, #2563EB 82%, #16C7E8 100%);
  --hero-primary-dance-width: 260px;
  --hero-primary-dance-timing: 2s;

  position: relative;
  color: #ffffff;
  background: var(--navy);
  background-size: 100% 100%;
  border: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s ease;
}

.hero-btn--primary:hover {
  background-image: linear-gradient(
    to right,
    #FF8C00,
    #FF8C00 16.65%,
    #FF5B2E 16.65%,
    #FF5B2E 33.3%,
    #FF2F86 33.3%,
    #FF2F86 49.95%,
    #9B42FF 49.95%,
    #9B42FF 66.6%,
    #2563EB 66.6%,
    #2563EB 83.25%,
    #16C7E8 83.25%,
    #16C7E8 100%,
    #FF8C00 100%
  );
  background-size: var(--hero-primary-dance-width) 100%;
  animation: heroPrimaryDance var(--hero-primary-dance-timing) linear infinite;
  transform: scale(1.04) translateY(-1px);
}

.hero-btn--primary:active {
  transform: scale(0.96);
}

@keyframes heroPrimaryDance {
  to {
    background-position: var(--hero-primary-dance-width) 0;
  }
}


.hero-btn--secondary {
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.hero-btn--secondary:active {
  transform: scale(0.96);
}

.home-proof {
  margin-top: 34px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.home-proof__avatars {
  display: flex;
  align-items: center;
}

.home-proof__avatar {
  width: 42px;
  height: 42px;
  margin-left: -8px;
  border-radius: 999px;
  border: 3px solid #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.home-proof__avatar:first-child {
  margin-left: 0;
}

.home-proof__avatar:nth-child(1) {
  background: linear-gradient(135deg, #fb923c, #f43f5e);
}

.home-proof__avatar:nth-child(2) {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}

.home-proof__avatar:nth-child(3) {
  background: linear-gradient(135deg, #a78bfa, #ec4899);
}

.home-proof__avatar:nth-child(4) {
  background: linear-gradient(135deg, #34d399, #14b8a6);
}

.home-proof__rating {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.home-proof__stars {
  font-size: 18px;
  line-height: 1;
  color: #f59e0b;
  letter-spacing: 0.08em;
}

.home-proof__caption {
  font-size: 16px;
  color: #64748b;
  letter-spacing: -0.02em;
}

.home-hero__visual {
  position: relative;
  min-height: 540px;
  overflow: visible;
}

.hero-badge {
  position: absolute;
  right: 30px;
  min-width: 128px;
  height: 50px;
  padding: 0 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  z-index: 3;
}

.hero-badge--top {
  top: 54px;
  right: 114px;
}

.hero-badge--bottom {
  top: 120px;
  right: 48px;
}

.hero-badge__icon-svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: block;
  color: #334155;
}

.hero-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.hero-badge__dot--pink {
  background: #ff4db8;
}

.hero-badge__dot--coastal {
  background: #38a8e8;
}

.hero-badge__dot--violet {
  background: #635bff;
}

.home-hero__arrow {
  position: absolute;
  top: 162px;
  left: 190px;
  width: 144px;
  height: 108px;
  z-index: 2;
  color: #233252;
}

.home-hero__arrow-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-hero__arrow marker path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.palette-preview {
  position: absolute;
  right: 0;
  top: 258px;
  width: min(100%, 570px);
  padding: 26px 22px 18px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #eef2f7;
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  transform: rotate(-4deg);
  z-index: 2;
}

.palette-preview__swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.palette-preview__swatch {
  height: 190px;
  border-radius: 16px;
}

.palette-preview__codes {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.palette-preview__codes span {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  text-align: center;
  letter-spacing: -0.02em;
}

.hero-splash {
  position: absolute;
  display: block;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.hero-splash--left {
  left: -44px;
  bottom: 8px;
  width: 90px;
  z-index: 1;
  opacity: 0.98;
}

.hero-splash--right {
  right: -92px;
  bottom: -34px;
  width: 248px;
  z-index: 1;
  opacity: 0.98;
}

.hero-dropper {
  position: absolute;
  right: 42px;
  bottom: -44px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #e9eef5;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #635bff;
  z-index: 4;
}

.hero-dropper::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  border: 0.5px solid #c8c6f6;
  pointer-events: none;
}

.hero-dropper img {
  width: 32px;
  height: 32px;
  display: block;
  position: relative;
  z-index: 1;
}


@media (max-width: 1240px) {
  .home-hero {
    padding: 24px 0 64px;
  }

  .home-hero__inner {
    grid-template-columns: 1fr;
  }

  .home-hero__content {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.home-hero__title {
  transform-origin: center bottom;
  margin: 0 auto;
}

  .home-hero__find {
    font-size: clamp(92px, 14vw, 148px);
  }

  .home-hero__color-word {
    width: clamp(340px, 48vw, 600px);
  }

.home-hero__visual {
  width: min(760px, 100%);
  min-height: 390px;
  margin: -40px auto 0;
}
  
  .home-hero__text {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.home-hero__actions {
  justify-content: center;
}

.home-proof {
  justify-content: center;
}

  .hero-badge {
    display: none;
  }

.home-hero__arrow {
  display: block;
  top: 18px;
  left: 42%;
  width: 130px;
  height: 96px;
}

.palette-preview {
  top: 112px;
  right: 50%;
  width: min(570px, 86vw);
  transform: translateX(50%) rotate(-4deg);
}

  .hero-splash--left {
    left: 8%;
    bottom: 92px;
    width: 82px;
  }

  .hero-splash--right {
    right: 2%;
    bottom: 38px;
    width: 210px;
  }

.hero-dropper {
  right: calc(50% - 235px);
  bottom: -46px;
}

  }

@media (max-width: 900px) {
  .home-hero__content {
    max-width: 680px;
  }
  
  

  .home-hero__find {
    font-size: clamp(78px, 15vw, 118px);
  }

  .home-hero__color-word {
    width: clamp(300px, 52vw, 500px);
    transform: translateY(8px) rotate(356deg);
  }

  .home-hero__actions {
    flex-direction: column;
    align-items: center;
    margin-top: 32px;
  }

  .hero-btn {
    width: auto;
    min-width: 320px;
    justify-content: center;
  }

  .home-proof {
    justify-content: center;
  }

  .home-hero__visual {
    min-height: 390px;
  }

  .home-hero__arrow {
    top: 36px;
    left: 39%;
    width: 118px;
    height: 88px;
  }

  .palette-preview {
    top: 132px;
    width: min(520px, 88vw);
  }

  .palette-preview__swatch {
    height: 160px;
  }

  .hero-splash--right {
    width: 180px;
    right: 0;
    bottom: 42px;
  }
  
    .hero-dropper {
    display: none;
  }

  .hero-dropper img {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 760px) {
  .home-hero {
    padding: 22px 0 0;
  }

  .home-hero__inner {
    width: min(100%, calc(100% - 48px));
    gap: 30px;
  }

  .home-hero__content {
    max-width: 100%;
  }

  .home-hero__title {
    gap: 4px;
  }

  .home-hero__find {
    font-size: clamp(56px, 22vw, 96px);
  }

  .home-hero__color-word {
    width: clamp(230px, 56vw, 390px);
    transform: translateY(5px) rotate(356deg);
  }

  .home-hero__text {
    margin-top: 30px;
    font-size: 20px;
    line-height: 1.55;
  }

  .home-hero__actions {
    align-items: center;
    gap: 16px;
    margin-top: 32px;
  }

  .hero-btn {
    min-width: 300px;
    min-height: 58px;
    padding: 0 22px;
    font-size: 16px;
  }

  .home-proof {
    justify-content: center;
    gap: 16px;
  }

  .home-hero__visual {
    min-height: 325px;
    margin-top: 0;
  }

  .home-hero__arrow {
    top: -12px;
    left: 38%;
    width: 104px;
    height: 78px;
  }

  .palette-preview {
    top: 72px;
    width: min(480px, 88vw);
    padding: 20px 16px 14px;
    border-radius: 26px;
  }

  .palette-preview__swatches {
    gap: 10px;
  }

  .palette-preview__swatch {
    height: 132px;
    border-radius: 14px;
  }

  .palette-preview__codes {
    gap: 10px;
  }

  .palette-preview__codes span {
    font-size: 11px;
  }

  .hero-splash--left {
    left: 0;
    bottom: 76px;
    width: 74px;
  }

  .hero-splash--right {
    right: -8px;
    bottom: 42px;
    width: 150px;
  }

.hero-dropper {
  width: 66px;
  height: 66px;
  right: calc(50% - 190px);
  bottom: 40px;
}

  .hero-dropper img {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 560px) {
  .home-hero__inner {
    width: min(100%, calc(100% - 32px));
  }

  .home-hero__find {
    font-size: clamp(48px, 23vw, 76px);
  }

  .home-hero__color-word {
    width: clamp(190px, 58vw, 300px);
    transform: translateY(4px) rotate(356deg);
  }

  .home-hero__text {
    font-size: 18px;
  }

  .hero-btn {
    min-width: 280px;
  }

.home-proof {
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .home-proof__avatars {
    justify-content: center;
  }

  .home-proof__rating {
    justify-content: center;
  }

  .home-hero__visual {
    min-height: 265px;
  }

  .home-hero__arrow {
    top: -14px;
    width: 92px;
    height: 68px;
  }

  .palette-preview {
    top: 44px;
    width: min(420px, 90vw);
    padding: 16px 12px 12px;
    border-radius: 22px;
  }

  .palette-preview__swatches {
    gap: 8px;
  }

  .palette-preview__swatch {
    height: 110px;
    border-radius: 12px;
  }

  .palette-preview__codes span {
    font-size: 9px;
  }

  .hero-splash--left {
    width: 58px;
    bottom: 70px;
  }

  .hero-splash--right {
    width: 170px;
    right: -18px;
    bottom: 74px;
  }

.hero-dropper {
  width: 58px;
  height: 58px;
  right: calc(50% - 170px);
  bottom: 65px;
}

  .hero-dropper img {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 420px) {
  .home-hero__find {
    font-size: clamp(42px, 22vw, 58px);
  }

  .home-hero__color-word {
    width: clamp(165px, 56vw, 230px);
  }

  .home-hero__text {
    font-size: 17px;
  }

  .hero-btn {
    min-width: 260px;
    min-height: 56px;
    font-size: 15px;
  }

  .home-proof {
    gap: 14px;
  }

  .home-proof__caption {
    font-size: 15px;
  }

  .home-hero__visual {
    min-height: 280px;
  }

  .palette-preview {
    width: min(360px, 90vw);
  }

  .palette-preview__swatch {
    height: 92px;
  }

.hero-dropper {
  right: calc(50% - 176px);
  bottom: -2px;
}
}
  
/* ===== Home hero: narrow phones ===== */

@media (max-width: 430px) {
  .home-hero {
    padding-top: 18px;
  }

  .home-hero__inner {
    width: calc(100% - 28px);
    gap: 26px;
  }

  .home-hero__title {
    max-width: 100%;
    justify-content: center;
  }

  .home-hero__find {
    font-size: clamp(40px, 18vw, 56px);
  }

  .home-hero__color-word {
    width: clamp(150px, 48vw, 210px);
    transform: translateY(3px) rotate(356deg);
  }

  .home-hero__text {
    max-width: 320px;
    font-size: 16px;
    line-height: 1.5;
  }

  .hero-btn {
    min-width: 0;
    width: min(320px, 100%);
    min-height: 54px;
    font-size: 15px;
  }

  .home-proof {
    width: 100%;
    justify-content: center;
    gap: 14px;
  }

  .home-proof__avatars {
    width: 100%;
    justify-content: center;
  }

  .home-proof__rating {
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  .home-proof__caption {
    font-size: 14px;
    white-space: nowrap;
  }

  .home-hero__visual {
    width: 100%;
    max-width: 360px;
    min-height: 255px;
    left: auto;
    margin: -18px auto 0;
    transform: none;
    transform-origin: top center;
  }

  .home-hero__arrow {
    top: 8px;
    left: 50%;
    width: 82px;
    height: 62px;
    transform: translateX(-50%);
  }

  .palette-preview {
    top: 64px;
    right: 50%;
    width: 300px;
    max-width: calc(100vw - 36px);
    padding: 14px 10px 10px;
    border-radius: 20px;
    transform: translateX(50%) rotate(-4deg);
  }

  .palette-preview__swatches {
    gap: 7px;
  }

  .palette-preview__swatch {
    height: 84px;
    border-radius: 11px;
  }

  .palette-preview__codes {
    gap: 7px;
    margin-top: 10px;
  }

  .palette-preview__codes span {
    font-size: 8px;
  }

  .hero-splash--left {
    left: 2px;
    bottom: 58px;
    width: 50px;
  }

  .hero-splash--right {
    right: -10px;
    bottom: 40px;
    width: 120px;
  }

  .hero-dropper {
    width: 50px;
    height: 50px;
    right: calc(50% - 128px);
    bottom: 30px;
  }

  .hero-dropper img {
    width: 19px;
    height: 19px;
  }
}

@media (max-width: 380px) {
  .container {
    width: calc(100% - 28px);
  }

  .site-header__inner {
    min-height: 68px;
  }

  .site-logo__img {
    width: 70px;
  }

  .site-logo__text {
    font-size: 23px;
  }

  .site-menu-toggle,
  .site-menu__close {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .site-menu__bar {
    min-height: 68px;
  }

  .menu-band__inner {
    width: calc(100% - 28px);
  }

  .home-hero__inner {
    width: calc(100% - 24px);
  }

  .home-hero__find {
    font-size: clamp(38px, 17vw, 50px);
  }

  .home-hero__color-word {
    width: clamp(140px, 46vw, 180px);
  }

  .home-hero__text {
    max-width: 300px;
    font-size: 15px;
  }

  .hero-btn {
    width: min(300px, 100%);
    min-height: 52px;
    font-size: 14px;
  }

  .home-proof__caption {
    font-size: 13px;
  }

  .home-hero__visual {
    max-width: 330px;
    min-height: 208px;
    margin-top: -22px;
  }

  .palette-preview {
    top: 60px;
    width: 278px;
    padding: 13px 9px 9px;
  }

  .palette-preview__swatch {
    height: 76px;
    border-radius: 10px;
  }

  .palette-preview__codes span {
    font-size: 7.5px;
  }

  .hero-splash--left {
    width: 44px;
    bottom: 54px;
  }

  .hero-splash--right {
    width: 104px;
    right: -6px;
    bottom: 48px;
  }

  .hero-dropper {
    width: 46px;
    height: 46px;
    bottom: 33px;
  }

  .hero-dropper img {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 340px) {
  .home-hero__find {
    font-size: 36px;
  }

  .home-hero__color-word {
    width: 150px;
  }

  .palette-preview {
    width: 258px;
  }

  .palette-preview__swatch {
    height: 70px;
  }

  .hero-dropper {
    right: calc(50% - 108px);
  }
}

@media (max-width: 1180px) {
  .site-footer__inner {
    padding: 30px 0 38px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
  }

  .site-footer__copy {
    width: 100%;
  }

  .site-footer__copy p {
    max-width: none;
    margin: 0 auto;
    font-size: 14px;
    text-align: center;
  }

  .site-footer__links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  .site-footer__links {
    gap: 8px;
  }

  .site-footer__links a {
    min-height: 34px;
    padding: 0 13px;
    font-size: 13px;
  }

  .site-footer__copy p {
    max-width: 300px;
  }

  .site-footer__copy span[aria-hidden="true"] {
    margin: 0 8px;
  }
}
/* ============================================================
   MOODBOARD — side rail (visible only in fullscreen board mode)
   ============================================================ */
.mb-rail{
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  width: var(--mb-rail-w);
  box-sizing: border-box;
  border-left: 1px solid rgba(0,0,0,0.18);
  background: #ffffff;
  transition:
    width 420ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 420ms ease;
}

body.moodboard-fullscreen .mb-rail{
  display: block;
}

.mb-rail.is-open{
  width: min(340px, calc(100vw - 48px));
  box-shadow: -24px 0 70px rgba(15, 23, 42, 0.14);
}

/* Burger button: same icon/size as the mobile header menu */
.mb-rail__toggle{
  position: absolute;
  top: 14px;
  right: 0;
  z-index: 2;
  width: var(--mb-rail-w);
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.mb-rail.is-open .hamburger svg{
  transform: rotate(-45deg);
}

.mb-rail.is-open .hamburger .line-top-bottom{
  stroke-dasharray: 20 300;
  stroke-dashoffset: -32.42;
}

/* Panel content — centered vertically, fades in with the rail */
.mb-rail__panel{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
  padding: 74px 22px 28px;
  box-sizing: border-box;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms;
}

.mb-rail.is-open .mb-rail__panel{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 160ms;
}

.mb-rail__title{
  margin: 0;
  text-align: center;
}

/* On very narrow phones drop a size so "Moodboard" still fits one line */
@media (max-width: 400px){
  .mb-rail__title{
    font-size: 40px;
  }
}

.mb-rail__pick{
  white-space: nowrap;
}

.mb-rail__nav{
  display: grid;
  gap: 4px;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid #edf0f5;
}

.mb-rail__nav a{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
}

.mb-rail__nav a:hover{
  background: #f8fafc;
}

/* Keep the board clear of the rail */
body.moodboard-fullscreen #board{
  padding-right: calc(var(--outer) + var(--mb-rail-w));
}

/* Many images: the grid fallback may be a bit shorter than the screen —
   center it vertically instead of leaving all the empty space at the bottom.
   On phones the board scrolls, so it stays top-aligned there. */
@media (min-width: 769px){
  body.moodboard-fullscreen #board{
    justify-content: center;
  }
}

/* ===== Legal / text pages (Privacy, Cookies, Terms) ===== */

.legal-page {
  padding: 64px 0 104px;
}

.legal-doc {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
}

.legal-doc__head {
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.legal-doc__eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal-doc h1 {
  margin: 0 0 14px;
  font-size: 52px;
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.legal-doc__meta {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--muted);
}

.legal-doc__lead {
  margin: 0;
  font-size: 20px;
  line-height: 1.6;
  color: var(--muted);
}

.legal-doc section {
  margin-bottom: 44px;
}

.legal-doc section:last-child {
  margin-bottom: 0;
}

.legal-doc h2 {
  margin: 0 0 16px;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.legal-doc h3 {
  margin: 30px 0 12px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
}

.legal-doc p {
  margin: 0 0 16px;
}

.legal-doc p:last-child {
  margin-bottom: 0;
}

.legal-doc ul {
  margin: 0 0 16px;
  padding-left: 22px;
}

.legal-doc li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.legal-doc li::marker {
  color: #cbd5e1;
}

.legal-doc li:last-child {
  margin-bottom: 0;
}

.legal-doc strong {
  font-weight: 700;
  color: var(--text);
}

.legal-doc a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: #c7cedb;
}

.legal-doc a:hover {
  text-decoration-color: var(--text);
}

.legal-callout {
  margin-bottom: 48px;
  padding: 28px 32px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.legal-callout h2 {
  margin: 0 0 14px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.legal-callout ul {
  margin: 0;
}

@media (max-width: 768px) {
  .legal-page {
    padding: 40px 0 72px;
  }

  .legal-doc {
    font-size: 16px;
  }

  .legal-doc h1 {
    font-size: 36px;
  }

  .legal-doc__lead {
    font-size: 18px;
  }

  .legal-doc h2 {
    font-size: 22px;
  }

  .legal-doc__head {
    padding-bottom: 24px;
    margin-bottom: 32px;
  }

  .legal-doc section {
    margin-bottom: 36px;
  }

  .legal-callout {
    padding: 22px 20px;
    border-radius: 16px;
  }
}

/* Tables and inline code inside legal pages */

.legal-table {
  margin: 0 0 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.legal-doc table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}

.legal-doc thead th {
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

.legal-doc tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.legal-doc tbody tr:last-child td {
  border-bottom: 0;
}

.legal-doc code {
  padding: 2px 6px;
  background: #f1f5f9;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  word-break: break-word;
}

/* Key names in tables stay on one line - the wrapper scrolls instead */
.legal-doc td code {
  font-size: 0.85em;
  white-space: nowrap;
  word-break: normal;
}

/* On wide screens let the table spill a little past the text column,
   so the columns are not cramped */
@media (min-width: 1100px) {
  .legal-table {
    width: calc(100% + 160px);
    margin-left: -80px;
  }
}

@media (max-width: 768px) {
  .legal-doc table {
    font-size: 14px;
    min-width: 560px;
  }

  .legal-doc thead th,
  .legal-doc tbody td {
    padding: 12px 14px;
  }
}

/* On phones the table turns into stacked cards - no sideways scrolling */
@media (max-width: 640px) {
  .legal-table {
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .legal-doc table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .legal-doc thead {
    display: none;
  }

  .legal-doc tbody,
  .legal-doc tbody tr,
  .legal-doc tbody td {
    display: block;
    width: 100%;
  }

  .legal-doc tbody tr {
    margin-bottom: 14px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
  }

  .legal-doc tbody tr:last-child {
    margin-bottom: 0;
  }

  .legal-doc tbody td {
    padding: 0 0 14px;
    border: 0;
  }

  .legal-doc tbody tr td:last-child {
    padding-bottom: 0;
  }

  .legal-doc tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .legal-doc td code {
    white-space: normal;
    word-break: break-word;
  }
}

/* ===== Главная: четыре блока с описанием возможностей ===== */

.home-features {
  padding: 8px 0 96px;
  background: #ffffff;
}

/* Три колонки: картинка — кнопки — текст */
.feature-row {
  display: grid;
  grid-template-columns: 384px auto minmax(0, 1fr);
  align-items: center;
  column-gap: 24px;
}

.feature-row__body {
  padding-left: 16px;
}

.feature-row:nth-child(even) .feature-row__body {
  padding-left: 0;
  padding-right: 16px;
}

.feature-row + .feature-row {
  margin-top: 80px;
}

/* Шахматный порядок: у чётных блоков картинка и кнопки справа, текст слева */
.feature-row:nth-child(even) {
  grid-template-columns: minmax(0, 1fr) auto 384px;
}

/* Блок, у которого кнопок нет вовсе, — только картинка и текст */
.feature-row--plain {
  grid-template-columns: 384px minmax(0, 1fr);
}

.feature-row--plain:nth-child(even) {
  grid-template-columns: minmax(0, 1fr) 384px;
}

.feature-row__media {
  order: 1;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  background: #f1f3f7;
  overflow: hidden;
}

.feature-row__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-row__tools {
  order: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Блок с живым демо: там лежит настоящий SVG, серая заливка не нужна */
.feature-row__media--demo {
  background: #f1f3f7;
}

.feature-row__media--demo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.feature-row__tools--icons {
  gap: 12px;
  align-items: center;
}

/* Кнопки с иконкой в демо на главной. Стиль взят с кнопок режимов на
   /palette и /gradient-creator (.palette-mode-seg button в palette-legacy.css):
   невыбранная — серая заливка без обводки, выбранная — белая с тонким кольцом.
   Цвета и радиус повторены один в один, чтобы главная и сами инструменты
   выглядели одинаково. Дублировать пришлось потому, что palette-legacy.css
   на главную не подключён. При правке того файла править и здесь. */
.feature-row__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #fafafa;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.feature-row__icon-btn:hover {
  background: #f4f5f7;
}

.feature-row__icon-btn:active {
  transform: scale(0.94);
}

/* Выбранный режим — белая кнопка в тонком кольце */
.feature-row__icon-btn.is-active {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #e3e3e3;
}

/* Иконка — маска, а не картинка: тогда цвет задаётся здесь, в CSS, и все
   иконки в этих кнопках одного цвета. Сами файлы иконок залиты по-разному
   (замок чёрный, открытый замок серый), при вставке через <img> это не поправить. */
.feature-row__ico {
  width: 18px;
  height: 18px;
  background-color: #3f4654;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 0.2s ease;
}

.feature-row__ico[data-icon="reload"] {
  -webkit-mask-image: url('/icons/icon-reload.svg');
  mask-image: url('/icons/icon-reload.svg');
}

.feature-row__ico[data-icon="unlock"] {
  -webkit-mask-image: url('/icons/icon-unlock.svg');
  mask-image: url('/icons/icon-unlock.svg');
}

.feature-row__ico[data-icon="lock"] {
  -webkit-mask-image: url('/icons/icon-lock.svg');
  mask-image: url('/icons/icon-lock.svg');
}

.feature-row__ico[data-icon="upload"] {
  -webkit-mask-image: url('/icons/icon-upload.svg');
  mask-image: url('/icons/icon-upload.svg');
}

.feature-row__icon-btn.is-active .feature-row__ico {
  background-color: #111827;
}

/* Демо тональной проверки: две полосы во всю плашку, без промежутков —
   сверху цвета, снизу они же под выбранным режимом */
.feature-row__media--tone {
  display: flex;
  flex-direction: column;
  background: #f1f3f7;
}

/* Высоту рядов уточняет скрипт, чтобы шов между ними попал на целый пиксель
   экрана; 50% — запасное значение, пока скрипт не отработал. */
.tone-demo__row {
  flex: 0 0 auto;
  height: 50%;
  display: flex;
  min-height: 0;
}

.tone-demo__cell {
  flex: 1;
}

/* Демо палитры из фото: снимок сверху, извлечённые цвета лентой снизу */
.feature-row__media--photo {
  display: flex;
  flex-direction: column;
  background: #f1f3f7;
}

.photo-demo__img {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Высота ленты цветов подогнана под снимок: у него пропорция 1600x963,
   то есть 1.661:1, а плашка 4:3 — значит фото занимает 80.25% её высоты, и
   ленте остаётся 19.75%. Иначе низ снимка обрезался бы. Меняете фото —
   пересчитайте: лента = 100% - (высота/ширина фото) / 0.75 * 100%. */
.photo-demo__row {
  flex: 0 0 19.75%;
  display: flex;
}

.photo-demo__cell {
  flex: 1;
}

/* Демо градиента: холст во всю плашку и две точки поверх него */
.feature-row__media--gradient {
  position: relative;
  background: #f1f3f7;
}

.grad-demo__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.grad-demo__point {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  padding: 0;
  border: 3px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(2, 8, 23, 0.28);
  cursor: grab;
  /* Иначе пальцем по точке нельзя прокрутить страницу — браузер отдаёт жест нам */
  touch-action: none;
}

.grad-demo__point:active {
  cursor: grabbing;
}

/* Демо мудборда: доска с цветными «снимками», её тянут за уголок.
   Отдельной белой подложки нет — карточки лежат прямо на бумажном фоне
   плашки, иначе получается окно внутри окна. */
.feature-row__media--board {
  position: relative;
  background: transparent;
}

/* Бумажный фон лежит на самой доске, а не на плашке: тогда при перетаскивании
   уголка ужимается всё окно целиком, а не только карточки внутри него. */
.board-demo {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: #f2f0ea;
}

/* Поля считает скрипт (они должны быть равны со всех сторон), поэтому здесь
   только центрирование. */
.board-demo__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  justify-content: center;
}

.board-demo__row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: stretch;
}

.board-demo__item {
  flex: 0 0 auto;
  border-radius: 8px;
  cursor: grab;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.board-demo__item.is-dragging {
  opacity: 0.35;
  transform: scale(0.97);
  cursor: grabbing;
}

.board-demo__item.is-target {
  box-shadow: 0 0 0 3px rgba(2, 8, 23, 0.55);
  transform: scale(1.04);
}

/* Уголок: короткая дуга по радиусу скругления плашки — за неё доску ужимают.
   Радиус дуги (15) взят от радиуса плашки (20) с отступом внутрь. */
.board-demo__grip {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 40px;
  height: 40px;
  color: rgba(2, 8, 23, 0.62);
  cursor: nwse-resize;
  touch-action: none;
  transition: color 0.2s ease;
}

.board-demo__grip svg {
  display: block;
  width: 100%;
  height: 100%;
}

.board-demo__grip:hover {
  color: var(--text);
}

/* Демо игры: показ цвета со счётчиком, цветовой круг с курсором и сравнение.
   Слои лежат друг на друге, фазу переключает скрипт через data-phase. */
.feature-row__media--game {
  position: relative;
  background: #f1f3f7;
}

.game-demo__fill,
.game-demo__wheel,
.game-demo__compare {
  position: absolute;
  inset: 0;
  transition: opacity 0.35s ease;
}

.game-demo__wheel {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.game-demo__compare {
  display: flex;
  opacity: 0;
}

.game-demo__half {
  flex: 1;
}

.game-demo__count,
.game-demo__score {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  /* Мягкая тень вместо плашки: плашка спорила бы с самим цветом */
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.game-demo__count {
  font-size: 92px;
}

.game-demo__score {
  font-size: 58px;
  font-variant-numeric: tabular-nums;
}

/* Курсор на круге — то же белое кольцо, что у точек меша в блоке градиента */
.game-demo__cursor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(2, 8, 23, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.feature-row__media--game[data-phase="show"] .game-demo__count {
  opacity: 1;
}

.feature-row__media--game[data-phase="wheel"] .game-demo__wheel,
.feature-row__media--game[data-phase="wheel"] .game-demo__cursor {
  opacity: 1;
}

.feature-row__media--game[data-phase="compare"] .game-demo__compare,
.feature-row__media--game[data-phase="compare"] .game-demo__score {
  opacity: 1;
}

@media (max-width: 560px) {
  .game-demo__count {
    font-size: 76px;
  }

  .game-demo__score {
    font-size: 48px;
  }
}

/* Буква вместо иконки — тем же цветом, что иконки в соседних кнопках */
.feature-row__ico-text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #3f4654;
  transition: color 0.2s ease;
}

.feature-row__icon-btn.is-active .feature-row__ico-text {
  color: #111827;
}

/* Кнопка-образец: сама заливка и есть иконка, клик открывает редактор цвета */
.feature-row__icon-btn--color,
.feature-row__icon-btn--color:hover {
  background: var(--demo-color, #f0f1f3);
  box-shadow: inset 0 0 0 1px rgba(2, 8, 23, 0.12);
}

.feature-row__icon-btn--color:hover {
  box-shadow: inset 0 0 0 1px rgba(2, 8, 23, 0.12), 0 0 0 3px rgba(2, 8, 23, 0.08);
}

.feature-row__body {
  order: 3;
  min-width: 0;
}

.feature-row:nth-child(even) .feature-row__media {
  order: 3;
}

.feature-row:nth-child(even) .feature-row__body {
  order: 1;
}

.feature-row__title {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.feature-row__text {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.feature-row__link {
  display: inline-block;
  margin-top: 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  border-bottom: 1px solid rgba(2, 8, 23, 0.18);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.feature-row__link span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.feature-row__link:hover {
  border-bottom-color: rgba(2, 8, 23, 0.55);
}

.feature-row__link:hover span {
  transform: translateX(4px);
}

@media (max-width: 1080px) {
  .feature-row {
    grid-template-columns: 312px auto minmax(0, 1fr);
    column-gap: 20px;
  }

  .feature-row:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) auto 312px;
  }

  .feature-row--plain {
    grid-template-columns: 312px minmax(0, 1fr);
  }

  .feature-row--plain:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) 312px;
  }

  .feature-row + .feature-row {
    margin-top: 64px;
  }

  .feature-row__title {
    font-size: 26px;
  }

  .feature-row__body {
    padding-left: 12px;
  }

  .feature-row:nth-child(even) .feature-row__body {
    padding-right: 12px;
  }
}

@media (max-width: 900px) {
  .home-features {
    padding-bottom: 72px;
  }

  .home-features .container {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Узкий экран: картинка сверху, под ней ряд кнопок, дальше текст */
  .feature-row,
  .feature-row:nth-child(even),
  .feature-row--plain,
  .feature-row--plain:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 20px;
  }

  .feature-row + .feature-row {
    margin-top: 56px;
  }

  .feature-row__media,
  .feature-row:nth-child(even) .feature-row__media {
    order: 1;
  }

  .feature-row__body,
  .feature-row:nth-child(even) .feature-row__body {
    order: 3;
    padding-left: 0;
    padding-right: 0;
  }

  /* Колонки больше нет, кнопки лежат под картинкой во всю её ширину —
     значит и стоять они должны по центру, а не липнуть к левому краю. */
  .feature-row__tools {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .feature-row__tools--icons {
    align-items: center;
  }
}

@media (max-width: 560px) {
  .home-features {
    padding-bottom: 56px;
  }

  .feature-row,
  .feature-row:nth-child(even) {
    row-gap: 16px;
  }

  .feature-row + .feature-row {
    margin-top: 44px;
  }

  .feature-row__media {
    border-radius: 16px;
  }

  .feature-row__title {
    font-size: 22px;
    margin-bottom: 10px;
  }

  .feature-row__text {
    font-size: 16px;
  }

  .feature-row__icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .feature-row__ico {
    width: 16px;
    height: 16px;
  }

  .feature-row__link {
    font-size: 15px;
    margin-top: 14px;
  }
}

/* ===== 404 page ===== */

body.not-found-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.not-found {
  flex: 1;
  display: grid;
  place-items: center;
  padding-top: 40px;
  padding-bottom: 68px;
}

.not-found__content {
  width: min(720px, 100%);
  text-align: center;
}

.not-found__code {
  width: max-content;
  display: grid;
  grid-template-columns: 0.62em 0.8em 0.62em;
  align-items: center;
  justify-items: center;
  justify-content: center;
  column-gap: 0.08em;
  margin: 0 auto 28px;
  color: #020817;
  font-size: clamp(104px, 14vw, 154px);
  line-height: 0.8;
  font-weight: 850;
  letter-spacing: 0;
}

.not-found__digit {
  display: block;
  text-align: center;
}

.not-found__zero {
  position: relative;
  width: 0.8em;
  height: 0.8em;
  display: block;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #e34f4f 0deg,
    #dfc744 60deg,
    #49b968 120deg,
    #43b9c2 180deg,
    #536bd4 240deg,
    #bd55be 300deg,
    #e34f4f 360deg
  );
  box-shadow: 0 16px 38px rgba(91, 65, 216, 0.12);
}

.not-found__zero::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: #ffffff;
}

.not-found h1 {
  margin: 0;
  color: #020817;
  font-size: clamp(36px, 4.4vw, 54px);
  line-height: 1.02;
  font-weight: 820;
  letter-spacing: -0.05em;
}

.not-found__text {
  max-width: 620px;
  margin: 22px auto 0;
  color: #64708a;
  font-size: 18px;
  line-height: 1.65;
}

.not-found__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.not-found__button {
  min-height: 54px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.not-found__button:hover {
  transform: translateY(-2px);
}

.not-found__button--primary {
  color: #ffffff;
  background: #020817;
  box-shadow: 0 14px 30px rgba(2, 8, 23, 0.16);
}

.not-found__button--secondary {
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.not-found__button--secondary:hover {
  border-color: #cbd5e1;
}

.not-found__tools {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 38px;
}

.not-found__tools a {
  color: #475569;
  font-size: 14px;
  font-weight: 650;
}

.not-found__tools a:hover {
  color: #020817;
}

.not-found__tools span {
  display: inline-block;
  margin-left: 3px;
  transition: transform 0.2s ease;
}

.not-found__tools a:hover span {
  transform: translateX(3px);
}

@media (max-width: 640px) {
  .not-found {
    padding-top: 34px;
    padding-bottom: 64px;
  }

  .not-found__code {
    margin-bottom: 24px;
  }

  .not-found__text {
    font-size: 16px;
  }

  .not-found__actions {
    margin-top: 28px;
  }

  .not-found__button {
    width: min(330px, 100%);
  }

  .not-found__tools {
    max-width: 360px;
    margin: 32px auto 0;
    gap: 12px 20px;
  }
}
