/* ============================================================
   fnfd — design system «Тёплая роща / Warm Grove»
   Ребрендинг 2026-06: светлый тёплый лендинг. Мягкие, ненасыщенные
   зелёные (шалфей, мята, хвоя в пастели) на тёплом белом. Много
   воздуха. Фирменная сцена — «лес из чеков»: деревья с кронами из
   кассовых чеков, которые шумят и качаются.
   Используется ТОЛЬКО на index.html — полигон и ЛК живут на app.css.
   ============================================================ */

:root {
  /* --- тёплая светлая база --- */
  --paper:   #fcfbf6;   /* тёплый белый — фон */
  --cream:   #f5f2e9;   /* кремовый — чередование секций */
  --mist:    #eef3ea;   /* зелёная дымка */
  --card:    #ffffff;

  --ink:     #2f483a;   /* глубокий мягкий зелёный — текст (не чёрный!) */
  --ink-2:   #5b7765;   /* вторичный */
  --ink-3:   #8da394;   /* приглушённый */

  --green:    #639a7c;  /* главный — мягкий шалфей */
  --green-d:  #4c8266;  /* hover / насыщеннее чуть-чуть */
  --green-l:  #aecbb7;  /* светлая листва */
  --green-xl: #ddeadf;  /* совсем светлая подложка */
  --sun:      #f8ecd2;  /* тёплое солнце */
  --amber:    #dfb678;  /* янтарный — капля тепла */

  --line:    rgba(76, 130, 102, .16);
  --line-2:  rgba(76, 130, 102, .30);

  --shadow-soft: 0 24px 60px -28px rgba(47, 72, 58, .25);
  --shadow-card: 0 14px 40px -22px rgba(47, 72, 58, .22);

  --r:    14px;
  --r-lg: 22px;
  --maxw: 1140px;
  --gap:  clamp(18px, 2.8vw, 30px);

  --ff:   "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.66;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--green-l); color: var(--ink); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 4vw, 44px); }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(252, 251, 246, .82);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.hdr.lift { border-color: var(--line); box-shadow: 0 12px 30px -22px rgba(47,72,58,.25); }
.nav { display: flex; align-items: center; gap: 24px; height: 74px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; font-size: 21px; }
.brand .sprout {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(160deg, var(--green) 0%, var(--green-d) 100%);
  display: grid; place-items: center; color: #fff; font-size: 15px;
  box-shadow: 0 6px 16px -6px rgba(76, 130, 102, .55);
}
.brand small { font-family: var(--mono); font-size: 10px; color: var(--ink-3); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.nav .links { display: flex; gap: 22px; margin-left: auto; }
.nav .links a { color: var(--ink-2); font-size: 15px; transition: color .15s; }
.nav .links a:hover { color: var(--green-d); }
.nav .cta { margin-left: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--green); color: #fff;
  font-weight: 700; padding: 13px 24px; border-radius: 100px;
  box-shadow: 0 12px 28px -12px rgba(76, 130, 102, .55);
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { background: var(--green-d); transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(76, 130, 102, .6); }
.btn.ghost { background: #fff; color: var(--green-d); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--green), 0 12px 26px -16px rgba(76,130,102,.4); }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(54px, 8vw, 104px) 0 0; overflow: hidden; }
.hero .wrap { position: relative; z-index: 3; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--green-d); background: var(--green-xl);
  border-radius: 100px; padding: 7px 16px;
}
.eyebrow::before { content: "❀"; font-size: 11px; }
.hero h1 {
  font-size: clamp(40px, 6.6vw, 78px); line-height: 1.04; letter-spacing: -.035em;
  font-weight: 800; margin: 26px auto 0; max-width: 18ch;
}
.hero h1 em { font-style: normal; color: var(--green-d); position: relative; white-space: nowrap; }
.hero h1 em::after {
  content: ""; position: absolute; left: 2%; right: 2%; bottom: .04em; height: .28em;
  background: var(--green-xl); z-index: -1; border-radius: 6px;
}
.hero p.lead { color: var(--ink-2); font-size: clamp(17px, 2.1vw, 21px); margin: 24px auto 0; max-width: 56ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; justify-content: center; }
.hero-meta { display: flex; gap: clamp(22px, 4vw, 52px); margin-top: 52px; flex-wrap: wrap; justify-content: center; }
.hero-meta .m b { display: block; font-size: clamp(26px, 3vw, 34px); color: var(--green-d); letter-spacing: -.02em; font-weight: 800; }
.hero-meta .m span { font-size: 13px; color: var(--ink-3); letter-spacing: .04em; }

/* ============================================================
   ЛЕС ИЗ ЧЕКОВ — фирменная сцена
   Деревья строит landing.js; здесь — вся пластика.
   ============================================================ */
.forest {
  position: relative; height: clamp(300px, 38vw, 460px); margin-top: clamp(30px, 5vw, 60px);
  pointer-events: none;
}
.forest .sun {
  position: absolute; top: 4%; right: 12%;
  width: clamp(140px, 18vw, 230px); height: clamp(140px, 18vw, 230px); border-radius: 50%;
  background: radial-gradient(circle, var(--sun) 0%, rgba(248, 236, 210, .55) 45%, transparent 72%);
  animation: sunbreathe 9s ease-in-out infinite;
}
@keyframes sunbreathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.07); opacity: 1; } }

.forest .hill { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 50%; }
.forest .hill.h1 { bottom: -68%; width: 170%; height: 100%; background: #e7efe2; }
.forest .hill.h2 { bottom: -74%; width: 150%; height: 100%; background: #dce8d6; }
.forest .hill.h3 { bottom: -82%; width: 130%; height: 100%; background: #d0dfc9; }

.grove { position: absolute; inset: 0; z-index: 2; }

.tree {
  position: absolute; bottom: calc(6% + var(--lift, 0%)); left: var(--x);
  transform: translateX(-50%) scale(var(--s, 1));
  transform-origin: 50% 100%;
  width: 220px; height: 280px;
  animation: treesway var(--sw, 8s) ease-in-out infinite;
  animation-delay: var(--sd, 0s);
}
@keyframes treesway {
  0%, 100% { transform: translateX(-50%) scale(var(--s, 1)) rotate(-.9deg); }
  50%      { transform: translateX(-50%) scale(var(--s, 1)) rotate(1.1deg); }
}
.tree .trunk {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 17px; height: 128px; border-radius: 8px 8px 5px 5px;
  background: linear-gradient(180deg, #b49a78 0%, #a08363 100%);
}
.tree .trunk::before, .tree .trunk::after {
  content: ""; position: absolute; width: 10px; height: 44px;
  background: inherit; border-radius: 8px;
}
.tree .trunk::before { top: 4px; left: -9px; transform: rotate(38deg); }
.tree .trunk::after  { top: 12px; right: -9px; transform: rotate(-34deg); }
.tree .shadow {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  width: 130px; height: 22px; border-radius: 50%;
  background: rgba(76, 130, 102, .14); filter: blur(3px);
}
.tree .crown {
  position: absolute; left: 0; right: 0; top: 0; height: 200px;
  transform-origin: 50% 105%;
  animation: crownsway var(--cw, 6.5s) ease-in-out infinite;
  animation-delay: var(--cd, 0s);
}
@keyframes crownsway {
  0%, 100% { transform: rotate(-1.6deg); }
  50%      { transform: rotate(2deg); }
}

/* листок-чек */
.leaf {
  position: absolute; left: 50%; top: 50%;
  width: var(--w, 34px); height: var(--h, 46px);
  background: #fffefa;
  border: 1px solid rgba(76, 130, 102, .22);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 6px 14px -7px rgba(47, 72, 58, .3);
  clip-path: polygon(0 0, 100% 0, 100% 91%, 87.5% 100%, 75% 91%, 62.5% 100%, 50% 91%, 37.5% 100%, 25% 91%, 12.5% 100%, 0 91%);
  transform: translate(var(--lx), var(--ly)) rotate(var(--lr));
  animation: rustle var(--fdur, 3.2s) ease-in-out infinite;
  animation-delay: var(--fd, 0s);
}
@keyframes rustle {
  0%, 100% { transform: translate(var(--lx), var(--ly)) rotate(var(--lr)); }
  35%      { transform: translate(calc(var(--lx) + 2px), calc(var(--ly) - 3px)) rotate(calc(var(--lr) + var(--ra, 5deg))); }
  70%      { transform: translate(calc(var(--lx) - 1px), calc(var(--ly) + 1px)) rotate(calc(var(--lr) - 2deg)); }
}
/* строчки позиций на чеке */
.leaf::before {
  content: ""; position: absolute; left: 17%; right: 17%; top: 18%; height: 46%;
  background: repeating-linear-gradient(180deg,
    rgba(141, 163, 148, .55) 0 2px, transparent 2px 7px);
}
/* зелёная отметка «принят» */
.leaf::after {
  content: ""; position: absolute; left: 17%; bottom: 14%;
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--green-l);
  box-shadow: 10px 0 0 -2px var(--amber);
}
.leaf.ok::after { background: var(--green); }
.leaf.tint { background: #f2f7ee; }

/* летящие по ветру чеки */
.drift {
  position: absolute; top: -60px; left: var(--dx, 50%);
  width: 26px; height: 34px;
  background: #fffefa; border: 1px solid rgba(76, 130, 102, .25); border-bottom: none;
  border-radius: 3px 3px 0 0;
  clip-path: polygon(0 0, 100% 0, 100% 89%, 83% 100%, 66% 89%, 50% 100%, 33% 89%, 16% 100%, 0 89%);
  opacity: 0;
  animation: driftfall var(--ddur, 13s) linear infinite;
  animation-delay: var(--dd, 0s);
}
.drift::before {
  content: ""; position: absolute; left: 18%; right: 18%; top: 20%; height: 42%;
  background: repeating-linear-gradient(180deg, rgba(141,163,148,.5) 0 2px, transparent 2px 6px);
}
@keyframes driftfall {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: .9; }
  85%  { opacity: .9; }
  100% { transform: translate(var(--dwx, -120px), calc(100% + 540px)) rotate(var(--drot, -300deg)); opacity: 0; }
}

/* ---------- sections ---------- */
.sec { padding: clamp(72px, 9vw, 130px) 0; }
.sec.alt { background: var(--cream); }
.sec.mist { background: var(--mist); }
.sec-head { max-width: 62ch; margin: 0 auto clamp(36px, 5vw, 64px); text-align: center; }
.sec-head.left { text-align: left; margin-left: 0; }
.sec-head .eyebrow { margin-bottom: 18px; }
.sec-head h2 { font-size: clamp(28px, 4.2vw, 48px); letter-spacing: -.03em; line-height: 1.08; font-weight: 800; }
.sec-head p { color: var(--ink-2); margin-top: 16px; font-size: 18.5px; }

.grid { display: grid; gap: var(--gap); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 920px) { .g-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g-2 { grid-template-columns: 1fr; } }

.card {
  position: relative; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px;
  box-shadow: var(--shadow-card);
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-soft); }
.card h3 { font-size: 21px; margin: 16px 0 8px; letter-spacing: -.01em; }
.card p { color: var(--ink-2); font-size: 15.5px; }
.card .ic {
  width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px;
  background: var(--green-xl); color: var(--green-d); font-size: 23px;
}

/* лента шагов */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: f; }
@media (max-width: 920px) { .flow { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .flow { grid-template-columns: 1fr; } }
.flow .f {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px 24px 24px;
  box-shadow: var(--shadow-card);
}
.flow .f::before {
  counter-increment: f; content: counter(f);
  position: absolute; top: -14px; left: 22px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green); color: #fff; font-weight: 800; font-size: 14px;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px -6px rgba(76,130,102,.55);
}
.flow .f h4 { font-size: 17.5px; margin-top: 6px; }
.flow .f p { color: var(--ink-2); font-size: 14.5px; margin-top: 6px; }

/* код-карточка (светлая) */
.code-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-soft);
}
.code-card .bar {
  display: flex; align-items: center; gap: 8px; padding: 13px 18px;
  border-bottom: 1px solid var(--line); background: var(--cream);
}
.code-card .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--green-l); }
.code-card .bar i:nth-child(2) { background: var(--sun); }
.code-card .bar i:nth-child(3) { background: var(--green-xl); }
.code-card .bar span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-left: 8px; }
.code-card pre {
  font-family: var(--mono); font-size: clamp(12px, 1.5vw, 13.5px); line-height: 1.9;
  padding: 24px clamp(18px, 3vw, 30px); color: var(--ink-2); overflow-x: auto; white-space: pre;
}
.code-card pre b { color: var(--green-d); font-weight: 700; }
.code-card pre .k { color: var(--ink-3); }
.code-card pre .ok { color: var(--green-d); font-weight: 700; }

/* список галок */
.checks li { display: flex; gap: 13px; padding: 12px 0; border-bottom: 1px dashed var(--line); color: var(--ink-2); align-items: baseline; }
.checks li::before { content: "✓"; color: var(--green); font-weight: 800; }
.checks li:last-child { border-bottom: 0; }
.checks code { font-family: var(--mono); font-size: 13.5px; background: var(--mist); border-radius: 6px; padding: 2px 7px; color: var(--green-d); }

/* чипсы (ML-словарь) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip {
  font-family: var(--mono); font-size: 13px; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: 100px; padding: 7px 14px;
  box-shadow: 0 6px 14px -10px rgba(47,72,58,.3);
}
.chip b { color: var(--green-d); font-weight: 700; }

/* ---------- CTA band ---------- */
.band {
  position: relative; overflow: hidden;
  border-radius: calc(var(--r-lg) + 8px); padding: clamp(44px, 6vw, 76px);
  background: linear-gradient(150deg, #5d9478 0%, #47795d 100%);
  color: #fff; text-align: center;
  box-shadow: 0 36px 80px -36px rgba(47, 72, 58, .55);
}
.band::before, .band::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, .09);
}
.band::before { width: 340px; height: 340px; top: -160px; right: -100px; }
.band::after { width: 260px; height: 260px; bottom: -140px; left: -80px; }
.band h2 { font-size: clamp(28px, 4.2vw, 46px); letter-spacing: -.03em; position: relative; z-index: 1; }
.band p { color: rgba(255, 255, 255, .85); margin: 14px auto 30px; max-width: 52ch; position: relative; z-index: 1; }
.band .btn { background: #fff; color: var(--green-d); position: relative; z-index: 1; }
.band .btn:hover { background: var(--cream); }
.band .btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); }
.band .btn.ghost:hover { box-shadow: inset 0 0 0 1.5px #fff; }

/* ---------- footer ---------- */
.ftr { border-top: 1px solid var(--line); padding: 60px 0 44px; color: var(--ink-3); background: var(--cream); }
.ftr .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--gap); }
@media (max-width: 760px) { .ftr .cols { grid-template-columns: 1fr 1fr; } }
.ftr h5 { color: var(--ink-2); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.ftr a { display: block; color: var(--ink-3); padding: 5px 0; font-size: 15px; }
.ftr a.brand { display: flex; color: var(--ink); }
.ftr a:hover { color: var(--green-d); }
.ftr .bottom { margin-top: 44px; padding-top: 24px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; }

/* ---------- появление при скролле ---------- */
.io { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.io.in { opacity: 1; transform: none; }
.reveal { opacity: 0; transform: translateY(16px); animation: rise .8s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- адаптив сцены ---------- */
@media (max-width: 960px) {
  .nav .links { display: none; }
}
@media (max-width: 720px) {
  .tree.m-hide { display: none; }
  .forest { height: 280px; }
  .brand small { display: none; }
  .nav { height: 64px; gap: 12px; }
  .nav .cta { margin-left: auto; padding: 10px 18px; font-size: 15px; white-space: nowrap; }
}

/* ---------- уважение к reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tree, .tree .crown, .leaf, .drift, .forest .sun { animation: none !important; }
  .drift { display: none; }
  .io, .reveal { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
}
