/* ============================================================
   xflow — временный лендинг. Фирменные токены платформы.
   Чистый CSS. Палитра из app/globals.css + терракотовый акцент.
   Заголовки: Lora (serif). UI/текст: Inter (локально).
   ============================================================ */

@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('fonts/Inter-SemiBold.woff2') format('woff2');
}

:root {
  --bg: hsl(46.67 47.37% 96.27%);
  --bg-2: hsl(48 42% 97.5%);
  --fg: hsl(60 12% 22%);
  --muted: hsl(48 6% 46%);
  --placeholder: hsl(50 8% 50%);
  --border: hsl(50 14% 88%);
  --card: hsl(0 0% 100%);

  --primary: hsl(216 95% 42%);
  --primary-600: hsl(216 95% 35%);

  --terra: hsl(15 62% 58%);
  --terra-600: hsl(15 58% 50%);
  --green: hsl(146 42% 40%);

  --radius: 0.7rem;
  --maxw: 1180px;

  --shadow-sm: 0 1px 2px hsl(46 23% 19% / 0.05);
  --shadow-md: 0 10px 34px hsl(46 23% 19% / 0.08);
  --shadow-lg: 0 26px 64px hsl(30 50% 30% / 0.13);

  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.screen { position: relative; min-height: 100svh; display: flex; flex-direction: column; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  background: hsl(46.67 47.37% 96.27% / 0.7);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.header.scrolled { border-bottom-color: var(--border); background: hsl(46.67 47.37% 96.27% / 0.9); }
.header .inner { height: 70px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; }
.brand img { height: 26px; width: auto; display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: var(--radius);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease),
              box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-600); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-ghost { background: var(--card); color: var(--fg); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: hsl(15 50% 60% / 0.5); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14.5px; }

/* ---------- Hero ---------- */
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: safe center; text-align: center; padding: 56px 0 72px; }

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h1 .em { font-style: italic; color: var(--terra); font-weight: 500; letter-spacing: -0.01em; }

.lead {
  margin-top: 24px;
  font-size: clamp(16px, 1.7vw, 18.5px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 58ch;
}
.lead b { color: var(--fg); font-weight: 600; }

/* ---------- Prompt mockup ---------- */
.prompt {
  width: 100%; max-width: 680px; margin: 40px auto 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-md); padding: 22px 22px 16px; text-align: left;
}
.prompt .ph { font-size: 16.5px; color: var(--placeholder); min-height: 48px; padding-top: 4px; line-height: 1.45; }
.caret {
  display: inline-block; width: 2px; height: 1.05em; vertical-align: text-bottom;
  margin-left: 1px; background: var(--terra); animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.prompt-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 12px; }
.attach {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  border-radius: 11px; background: var(--bg-2);
  border: 1px solid var(--border); color: var(--muted);
}
.send { width: 42px; height: 42px; border-radius: 11px; background: var(--primary); color: #fff; display: grid; place-items: center; flex-shrink: 0; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 11px; background: var(--card);
  border: 1px solid var(--border); font-size: 14.5px; font-weight: 500; color: var(--fg);
  box-shadow: var(--shadow-sm);
}

/* ---------- Section 2 ---------- */
.collect { flex: 1; display: flex; flex-direction: column; justify-content: safe center; padding: 72px 0 24px; }
.kicker { text-align: center; text-transform: uppercase; letter-spacing: 0.18em; font-size: 12.5px; font-weight: 600; color: var(--muted); }
h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(28px, 4.4vw, 46px); line-height: 1.1; letter-spacing: -0.01em;
  text-align: center; margin-top: 14px;
}

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 46px; }
.show {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 14px; box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.show:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: hsl(15 50% 60% / 0.3); }
.show-art {
  height: 172px; border-radius: 12px; background: var(--bg-2);
  border: 1px solid var(--border); padding: 13px; overflow: hidden;
  display: flex; flex-direction: column;
}
.show-label { display: flex; align-items: center; gap: 11px; padding: 16px 6px 6px; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.show-label .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.ico-blue { background: hsl(216 95% 42% / 0.1); color: var(--primary); }
.ico-terra { background: hsl(15 62% 58% / 0.13); color: var(--terra-600); }
.ico-green { background: hsl(146 42% 40% / 0.12); color: var(--green); }
.ico-dark { background: hsl(60 12% 22% / 0.08); color: var(--fg); }

/* shared mockup helpers */
.av { width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 6.5px; font-weight: 700; color: #fff; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 7px; font-weight: 600; }
.delta svg { width: 6px; height: 6px; }
.delta.up { color: var(--green); }
.delta.down { color: var(--terra-600); }

/* mockup: CRM (сделки) */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; height: 100%; }
.kcol { display: flex; flex-direction: column; gap: 5px; }
.kcol .kh { display: flex; align-items: center; gap: 4px; font-size: 7.5px; font-weight: 600; color: var(--muted); }
.kdot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.kcnt { margin-left: auto; font-size: 7px; color: var(--muted); background: var(--bg); border-radius: 4px; padding: 0 4px; }
.deal { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 6px; display: flex; flex-direction: column; gap: 5px; box-shadow: 0 1px 1px hsl(46 23% 19% / 0.04); }
.deal-top { display: flex; align-items: center; gap: 4px; }
.deal-top .ln { height: 5px; border-radius: 2px; background: hsl(60 12% 22% / 0.16); flex: 1; }
.deal .sum { font-size: 8.5px; font-weight: 600; color: var(--fg); letter-spacing: -0.02em; }
.deal .av { width: 13px; height: 13px; font-size: 6px; }

/* mockup: dashboard */
.dash { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.metric { background: var(--card); border: 1px solid var(--border); border-radius: 7px; padding: 6px 7px; }
.metric .cap { font-size: 7.5px; color: var(--muted); font-weight: 500; }
.metric b { display: block; font-size: 13px; font-weight: 600; letter-spacing: -0.02em; margin: 1px 0; }
.chartwrap { position: relative; flex: 1; min-height: 0; }
.gridlines { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.gridlines i { height: 1px; background: hsl(60 12% 22% / 0.07); }
.chart { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 5px; height: 100%; }
.chart span { flex: 1; border-radius: 3px 3px 0 0; background: var(--primary); }

/* mockup: report (отчёты) */
.report { display: flex; flex-direction: column; gap: 9px; height: 100%; }
.rep-top { display: flex; align-items: center; justify-content: space-between; }
.rep-doc { width: 24px; height: 28px; border-radius: 5px; background: hsl(146 42% 40% / 0.14); color: var(--green); display: grid; place-items: center; font-size: 11px; font-weight: 700; font-family: var(--serif); }
.rep-pdf { font-size: 7.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--green); background: hsl(146 42% 40% / 0.12); padding: 3px 7px; border-radius: 5px; }
.rep-body { display: flex; align-items: center; gap: 12px; flex: 1; }
.rep-body svg { width: 56px; height: 56px; flex-shrink: 0; }
.rep-legend { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.rep-leg { display: flex; align-items: center; gap: 5px; }
.rep-leg i { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
.rep-leg .ln { height: 5px; flex: 1; border-radius: 2px; background: hsl(60 12% 22% / 0.13); }
.rep-leg b { font-size: 8px; color: var(--muted); font-weight: 600; }

/* mockup: база знаний */
.kb { display: flex; flex-direction: column; gap: 7px; height: 100%; }
.kb-search { display: flex; align-items: center; gap: 5px; height: 18px; border-radius: 6px; background: var(--card); border: 1px solid var(--border); padding: 0 7px; }
.kb-mag { width: 7px; height: 7px; border: 1.5px solid var(--muted); border-radius: 50%; opacity: 0.55; flex-shrink: 0; }
.kb-search .sl { height: 4px; flex: 1; max-width: 55%; border-radius: 2px; background: hsl(60 12% 22% / 0.1); }
.kb-body { display: grid; grid-template-columns: 58px 1fr; gap: 9px; flex: 1; }
.kb-side { display: flex; flex-direction: column; gap: 6px; }
.kb-item { display: flex; align-items: center; gap: 4px; }
.kb-item i { width: 6px; height: 6px; border-radius: 2px; background: hsl(15 62% 58% / 0.45); flex-shrink: 0; }
.kb-item .ln { height: 5px; flex: 1; border-radius: 2px; background: hsl(60 12% 22% / 0.12); }
.kb-item.active i { background: var(--terra); }
.kb-doc { display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--border); padding-left: 9px; }
.kb-h2 { height: 9px; width: 55%; border-radius: 3px; background: hsl(15 62% 58% / 0.45); }
.kb-line { height: 6px; border-radius: 3px; background: hsl(60 12% 22% / 0.1); }

/* mockup: канбан задач */
.tkan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; height: 100%; }
.tcol { display: flex; flex-direction: column; gap: 5px; }
.tcol .th { display: flex; align-items: center; gap: 3px; font-size: 7px; font-weight: 600; color: var(--muted); }
.tcol .th i { width: 4px; height: 4px; border-radius: 50%; flex-shrink: 0; }
.tcol .th b { margin-left: auto; opacity: 0.7; }
.task { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 5px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 1px hsl(46 23% 19% / 0.04); }
.task .lbl { height: 3px; width: 55%; border-radius: 2px; }
.task .tt { height: 5px; border-radius: 2px; background: hsl(60 12% 22% / 0.15); }
.task .tt.s { width: 72%; }
.task-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 1px; }
.task .av { width: 12px; height: 12px; font-size: 5.5px; }
.task .chk { width: 9px; height: 9px; border-radius: 3px; border: 1.5px solid var(--muted); flex-shrink: 0; }
.task.done .chk { background: var(--green); border-color: var(--green); }
.task.done .tt { opacity: 0.45; }

/* mockup: расчёт зарплаты */
.pay { display: flex; flex-direction: column; height: 100%; }
.pay-h { display: flex; align-items: center; font-size: 6.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.pay-h .r { margin-left: auto; }
.emp { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid hsl(60 12% 22% / 0.06); }
.emp .nm { height: 5px; flex: 1; max-width: 40%; border-radius: 2px; background: hsl(60 12% 22% / 0.14); }
.emp .pill { font-size: 6px; font-weight: 600; padding: 2px 5px; border-radius: 4px; color: var(--green); background: hsl(146 42% 40% / 0.12); }
.emp .amt { font-size: 8.5px; font-weight: 600; color: var(--fg); margin-left: auto; letter-spacing: -0.02em; }
.emp .av { width: 13px; height: 13px; font-size: 6px; }
.pay-total { display: flex; align-items: center; padding-top: 6px; margin-top: auto; }
.pay-total .lbl { font-size: 9px; color: var(--muted); font-weight: 600; }
.pay-total .amt { font-size: 11px; font-weight: 700; color: var(--green); margin-left: auto; letter-spacing: -0.02em; }

/* mockup: аналитика маркетплейсов */
.mp { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.mp-stats { display: flex; gap: 6px; }
.mp-stat { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 7px; padding: 5px 7px; }
.mtag { font-size: 7px; font-weight: 700; letter-spacing: 0.04em; padding: 2px 6px; border-radius: 4px; display: inline-block; }
.mp-stat b { display: block; font-size: 11px; font-weight: 600; letter-spacing: -0.02em; margin: 3px 0 1px; }
.mpchart { display: flex; align-items: flex-end; gap: 7px; flex: 1; }
.mpgrp { flex: 1; display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.mpgrp span { flex: 1; border-radius: 2px 2px 0 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 24px 0; margin-top: 48px; }
.footer .inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13.5px; color: var(--muted); }
.footer a { color: var(--fg); font-weight: 500; }
.footer a:hover { color: var(--primary); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.d1 { transition-delay: 0.04s; } .d2 { transition-delay: 0.12s; }
.d3 { transition-delay: 0.2s; } .d4 { transition-delay: 0.28s; } .d5 { transition-delay: 0.36s; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-top: 40px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .cards { grid-template-columns: 1fr; }
  .prompt-foot { flex-wrap: wrap; }
  h1 { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .caret { animation: none; }
}
