/* Дизайн-система платформы: светлый тёплый премиум (решение 27.10). Все цвета — токены. */
:root {
  --bg: #faf6f1;
  --bg-deep: #f3ece4;
  --surface: #ffffff;
  --ink: #1e1a1d;
  --ink-2: #4a4246;
  --muted: #7a6f73;
  --line: #ebe2d8;
  --accent: #6b2d5c;
  --accent-hover: #57224a;
  --accent-soft: #f4e9f0;
  --accent-ink: #ffffff;
  --gold: #c58b2a;
  --ok: #2e7d5b;
  --ok-soft: #e6f3ec;
  --wa: #1fa855;
  --danger: #a3202f;
  --danger-soft: #fdeff0;

  --r-lg: 24px;
  --r: 16px;
  --r-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(30, 26, 29, .06), 0 2px 8px rgba(30, 26, 29, .05);
  --shadow: 0 2px 6px rgba(30, 26, 29, .05), 0 16px 40px rgba(60, 30, 50, .10);
  --shadow-lg: 0 30px 80px rgba(60, 30, 50, .18);

  --font: "Manrope", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 17px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* типографика */
.h-display { font-size: clamp(36px, 7.4vw, 64px); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; margin: 0; }
.h-display em { font-style: normal; color: var(--accent); }
.h-section { font-size: clamp(28px, 4.6vw, 42px); line-height: 1.1; letter-spacing: -.025em; font-weight: 800; margin: 0 0 12px; }
.h-card { font-size: 21px; line-height: 1.2; letter-spacing: -.01em; font-weight: 800; margin: 0; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-2); margin: 16px 0 0; max-width: 620px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* шапка */
.top { position: sticky; top: 0; z-index: 20; background: rgba(250, 246, 241, .86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: 17px; }
.top nav { display: none; gap: 26px; margin-left: 28px; }
.top nav a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.top nav a:hover { color: var(--accent); }
.top .spacer { flex: 1; }
@media (min-width: 900px) { .top nav { display: flex; } }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 26px;
  border: 0; border-radius: 999px; font: 700 17px/1 var(--font); cursor: pointer; text-decoration: none; transition: background .15s, transform .1s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px rgba(107, 45, 92, .28); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-secondary:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; box-shadow: none; }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }

/* бейджи и чипы */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--ok-soft); color: var(--ok); }
.badge.soon { background: var(--bg-deep); color: var(--muted); }
.badge.pro { background: var(--accent-soft); color: var(--accent); }
.trust { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; color: var(--ink-2); font-size: 15px; font-weight: 600; }
.trust span { display: inline-flex; align-items: center; gap: 8px; }
.trust svg { flex: none; color: var(--ok); }

/* карточки */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }

/* до / после */
.ba { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--bg-deep); user-select: none; touch-action: pan-y; aspect-ratio: 4 / 5; }
.ba > img, .ba > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba > .after { clip-path: inset(0 0 0 var(--cut, 50%)); }
.ba .ba-line { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 10px rgba(0,0,0,.25); pointer-events: none; }
.ba .ba-knob { position: absolute; top: 50%; left: var(--cut, 50%); width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; pointer-events: none; color: var(--accent); }
.ba .ba-tag { position: absolute; top: 12px; padding: 5px 12px; border-radius: 999px; background: rgba(30, 26, 29, .58); color: #fff; font-size: 13px; font-weight: 700; pointer-events: none; backdrop-filter: blur(6px); }
.ba .ba-tag.l { left: 12px; } .ba .ba-tag.r { right: 12px; }
.ba input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }

/* формы */
.field-label { display: block; font-weight: 800; font-size: 15px; margin: 22px 0 10px; }
.input { width: 100%; font: 600 18px var(--font); padding: 16px 18px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); transition: border-color .15s; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 11px 16px; font: 700 15px var(--font); cursor: pointer; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* секции */
.section { padding: 72px 0; }
@media (min-width: 900px) { .section { padding: 104px 0; } }
.section-head { max-width: 680px; margin-bottom: 36px; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* подвал */
.foot { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 15px; }
.foot .wrap { display: grid; gap: 18px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* мелочи */
.fade-up { animation: fadeUp .5s ease-out both; }
@keyframes fadeUp { from { transform: translateY(10px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* смена кадров вместо шторки — для пар, где нейросеть меняет масштаб («Мир рисунка») */
.ba.fade > .after { clip-path: none; animation: xfade 6s ease-in-out infinite; }
.ba.fade .ba-line { display: none; }
.ba.fade .ba-tag.l { animation: xfade 6s ease-in-out infinite reverse; }
.ba.fade .ba-tag.r { left: 12px; right: auto; animation: xfade 6s ease-in-out infinite; }
@keyframes xfade { 0%, 38% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }

/* аккаунт в шапке */
.acct { display: flex; align-items: center; gap: 10px; }
.balance-pill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 800; text-decoration: none; }
.balance-pill .coin { font-size: 13px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; }
.avatar-ph { display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; border-radius: 50%; }
.acct-link { text-decoration: none; display: block; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--line); }

/* ===================== Оболочка приложения (кабинет после входа) ===================== */
body.app { background: var(--bg); }
body.app > header.top { display: none; }
.shell { display: grid; grid-template-columns: 284px minmax(0, 1fr); min-height: 100vh; }
.shell.with-lib { grid-template-columns: 284px minmax(0, 1fr) 360px; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px 16px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; z-index: 40; }
.side .brand { padding: 4px 10px 16px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: background .15s, color .15s; }
.side-nav a span:not(.tag) { overflow: hidden; text-overflow: ellipsis; }
.side-nav a:hover { background: var(--bg); color: var(--ink); }
.side-nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.side-nav a svg { flex: none; opacity: .85; }
.side-nav a .tag { margin-left: auto; flex: none; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.side-nav a .tag.soon { background: var(--bg-deep); color: var(--muted); }
.side-nav a.on .tag { background: var(--surface); }
.side-sec { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 18px 12px 6px; }
.side-bottom { margin-top: auto; display: grid; gap: 10px; padding-top: 16px; }
.promo { display: block; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, #fbe9ef, #f4e9f0); text-decoration: none; color: var(--ink); }
.promo b { display: block; font-size: 14px; }
.promo span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.wallet { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.wallet .n { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.wallet .n small { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.wallet p { margin: 2px 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.35; }
.wallet .btn { width: 100%; min-height: 44px; font-size: 15px; }
.me-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.me-row:hover { background: var(--bg); }
.me-row b { display: block; font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.me-row small { color: var(--muted); font-size: 12px; font-weight: 600; }
.app-main { min-width: 0; }
.lib { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 18px; border-left: 1px solid var(--line); background: var(--surface); }
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.lib-head h2 { font-size: 18px; margin: 0; display: flex; align-items: center; gap: 8px; }
.lib-head a { font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; }
.lib-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.lib-tabs button { border: 0; background: var(--bg); color: var(--ink-2); border-radius: 999px; padding: 7px 13px; font: 700 13px var(--font); cursor: pointer; }
.lib-tabs button.on { background: var(--accent); color: #fff; }
.lib-list { display: grid; gap: 10px; }
.lib-item { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 14px; cursor: pointer; border: 0; background: none; text-align: left; font: inherit; color: var(--ink); width: 100%; }
.lib-item:hover { background: var(--bg); }
.lib-item .th { position: relative; flex: none; width: 64px; height: 80px; border-radius: 10px; overflow: hidden; background: var(--bg-deep); }
.lib-item .th img, .lib-item .th video { width: 100%; height: 100%; object-fit: cover; }
.lib-item .th i { position: absolute; left: 4px; bottom: 4px; font-style: normal; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: rgba(30,26,29,.65); color: #fff; }
.lib-item b { display: block; font-size: 14px; line-height: 1.25; }
.lib-item small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 3px; }
.lib-empty { text-align: center; padding: 40px 12px; color: var(--ink-2); }
.lib-empty .ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 28px; }
.lib-empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.lib-empty p { margin: 0; font-size: 14px; }
.lib-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .lib-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .lib-grid { grid-template-columns: repeat(4, 1fr); } }
.lib-grid .lib-item { flex-direction: column; align-items: stretch; padding: 0; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.lib-grid .lib-item .th { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 0; }
.lib-grid .lib-item .tx { padding: 10px 12px 12px; }
/* мобильная шапка и выезжающее меню */
.mbar { display: none; }
.side-close { display: none; }
@media (max-width: 1279px) {
  .shell.with-lib { grid-template-columns: 284px minmax(0, 1fr); }
  .shell.with-lib .lib { grid-column: 2; position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); background: transparent; padding: 24px 16px 60px; max-width: 640px; width: 100%; margin: 0 auto; }
}
@media (max-width: 960px) {
  .shell, .shell.with-lib { grid-template-columns: minmax(0, 1fr); }
  .shell.with-lib .lib { grid-column: 1; }
  .mbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; height: 60px; padding: 0 12px; background: rgba(250,246,241,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .mbar .burger { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
  .mbar .brand { font-size: 18px; }
  .mbar .spacer { flex: 1; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 290px; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .side-close { display: grid; place-items: center; position: absolute; top: 16px; right: 12px; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--bg); cursor: pointer; font-size: 18px; color: var(--ink-2); }
  .scrim { position: fixed; inset: 0; background: rgba(30,26,29,.35); z-index: 35; display: none; }
  .scrim.on { display: block; }
}
/* просмотр работы */
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(20,12,18,.75); display: none; align-items: center; justify-content: center; padding: 16px; }
.viewer.on { display: flex; }
.viewer .box { background: var(--surface); border-radius: var(--r-lg); width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); }
.viewer .media img, .viewer .media video { width: 100%; display: block; max-height: 62vh; object-fit: contain; background: #111; }
.viewer .body { padding: 16px; display: grid; gap: 10px; }
.viewer .body b { font-size: 17px; }
.viewer .body small { color: var(--muted); font-weight: 600; }
.viewer .x { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff; font-size: 20px; cursor: pointer; }
