/* ============================================================
   fnfd — design system «Fiscal Terminal / Phosphor Green»
   Концепт: фискальный терминал кассы. Тёмная глубокая зелень
   (изумруд/хвоя) как корпус прибора, фосфор-лайм — свечение
   индикатора/дисплея. Моноширинный «фискальный» шрифт для
   данных (ФН/ФД/ФП, суммы), гуманистический гротеск — для речи.
   Намеренно НЕ повторяет светлую «бумагу» apm-check.ru:
   другой носитель — светящийся экран, не термобумага.
   ============================================================ */

:root {
  /* --- зелёная база (насыщенные тона) --- */
  --bg:      #04130b;   /* почти чёрный с хвойным подтоном */
  --bg-2:    #07210f;   /* глубокий лес — секции */
  --panel:   #0a2a16;   /* корпус прибора */
  --panel-2: #0e3a1e;   /* приподнятая панель */
  --line:    rgba(120, 240, 160, .14);
  --line-2:  rgba(120, 240, 160, .28);

  --ink:     #e7ffe9;   /* свет на тёмном — почти белый с зеленцой */
  --ink-2:   #9fd8ad;   /* вторичный (мятный) */
  --ink-3:   #5f9a72;   /* приглушённый */

  --acid:    #6bff5b;   /* фосфор-лайм — свечение индикатора (главный акцент) */
  --acid-2:  #38e07f;   /* изумрудно-зелёный hover */
  --emerald: #11a85a;   /* насыщенный изумруд — заливки */
  --acid-ink:#04130b;   /* текст на акценте */
  --stamp:   #ff5d3b;   /* единственный тёплый — штамп «ОТКЛОНЁН» */
  --gold:    #ffd54a;   /* «на проверке» */

  --r:    6px;
  --r-lg: 14px;
  --maxw: 1180px;
  --gap:  clamp(16px, 2.6vw, 28px);

  --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(--bg);
  color: var(--ink);
  line-height: 1.62;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* атмосфера: радиальное свечение + тончайшие «строки развёртки» */
  background-image:
    radial-gradient(1100px 600px at 80% -10%, rgba(17,168,90,.20), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(107,255,91,.08), transparent 55%),
    repeating-linear-gradient(0deg, rgba(120,240,160,.030) 0 1px, transparent 1px 4px);
  background-attachment: fixed;
}
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(--acid); outline-offset: 2px; }
::selection { background: var(--acid); color: var(--acid-ink); }

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

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(4,19,11,.92), rgba(4,19,11,.66));
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 22px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; font-size: 20px; }
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--acid);
  box-shadow: 0 0 0 3px rgba(107,255,91,.18), 0 0 14px 2px var(--acid);
  animation: pulse 2.4s infinite ease-in-out;
}
@keyframes pulse { 0%,100%{opacity:.55;transform:scale(.9)} 50%{opacity:1;transform:scale(1.12)} }
.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: 20px; margin-left: auto; }
.nav .links a { color: var(--ink-2); font-size: 15px; transition: color .15s; }
.nav .links a:hover { color: var(--acid); }
.nav .cta { margin-left: 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--acid); color: var(--acid-ink);
  font-weight: 700; padding: 12px 20px; border-radius: var(--r);
  box-shadow: 0 0 0 1px rgba(107,255,91,.5), 0 8px 30px -8px rgba(107,255,91,.5);
  transition: transform .12s, box-shadow .2s, background .2s;
}
.btn:hover { background: var(--acid-2); transform: translateY(-2px); box-shadow: 0 0 0 1px var(--acid), 0 14px 34px -8px rgba(56,224,127,.6); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--acid); color: var(--acid); transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(60px,9vw,120px) 0 clamp(40px,6vw,80px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--acid); border: 1px solid var(--line-2); border-radius: 100px; padding: 6px 14px;
}
.eyebrow::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--acid); box-shadow:0 0 8px var(--acid); }
.hero h1 {
  font-size: clamp(38px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -.035em;
  font-weight: 800; margin: 22px 0 0; max-width: 16ch;
}
.hero h1 em { font-style: normal; color: var(--acid); text-shadow: 0 0 30px rgba(107,255,91,.4); }
.hero p.lead { color: var(--ink-2); font-size: clamp(17px,2.1vw,21px); margin-top: 22px; max-width: 54ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 30px; margin-top: 46px; flex-wrap: wrap; font-family: var(--mono); }
.hero-meta .m b { display: block; font-size: 30px; color: var(--acid); letter-spacing: -.02em; }
.hero-meta .m span { font-size: 12px; color: var(--ink-3); letter-spacing: .06em; }

/* «дисплей кассы» в герое */
.terminal {
  margin-top: 54px; border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.7), inset 0 1px 0 rgba(120,240,160,.12);
}
.terminal .bar { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.2); }
.terminal .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--ink-3); opacity: .5; }
.terminal .bar i:first-child { background: var(--acid); opacity: .9; }
.terminal .bar span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-left: 8px; }
.terminal pre {
  font-family: var(--mono); font-size: clamp(12px,1.5vw,14px); line-height: 1.85;
  padding: 22px clamp(16px,3vw,30px); color: var(--ink-2); overflow-x: auto; white-space: pre;
}
.terminal pre b { color: var(--acid); }
.terminal pre .ok { color: var(--emerald); font-weight: 700; }
.terminal pre .key { color: var(--ink-3); }

/* ---------- sections ---------- */
.sec { padding: clamp(54px,7vw,96px) 0; }
.sec.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { max-width: 60ch; margin-bottom: clamp(30px,4vw,52px); }
.sec-head .eyebrow { margin-bottom: 16px; }
.sec-head h2 { font-size: clamp(28px,4vw,46px); letter-spacing: -.03em; line-height: 1.08; font-weight: 800; }
.sec-head p { color: var(--ink-2); margin-top: 14px; font-size: 18px; }

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

.card {
  position: relative; background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: 0 26px 50px -28px rgba(0,0,0,.8); }
.card .num { font-family: var(--mono); font-size: 13px; color: var(--acid); letter-spacing: .1em; }
.card h3 { font-size: 20px; margin: 14px 0 8px; letter-spacing: -.01em; }
.card p { color: var(--ink-2); font-size: 15.5px; }
.card .ic { width: 42px; height: 42px; display:grid; place-items:center; border-radius: 10px; background: rgba(107,255,91,.1); border:1px solid var(--line-2); color: var(--acid); font-size: 20px; }

/* шаги пайплайна */
.steps { counter-reset: s; display:grid; gap: 2px; border:1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.step { display:flex; gap:20px; padding: 22px clamp(18px,3vw,30px); background: var(--panel); align-items:flex-start; }
.step:nth-child(even){ background: var(--bg-2); }
.step::before { counter-increment: s; content: counter(s,decimal-leading-zero); font-family: var(--mono); color: var(--acid); font-size: 14px; padding-top: 3px; min-width: 34px; }
.step h4 { font-size: 18px; }
.step p { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.step .chip { font-family: var(--mono); font-size: 11px; color: var(--ink-3); border:1px solid var(--line); padding: 2px 8px; border-radius: 100px; margin-left: 8px; }

/* список галок */
.checks li { display:flex; gap:12px; padding: 11px 0; border-bottom: 1px dashed var(--line); color: var(--ink-2); }
.checks li::before { content:"✓"; color: var(--acid); font-weight: 800; }
.checks li:last-child { border-bottom: 0; }

/* ---------- CTA band ---------- */
.band {
  border-radius: var(--r-lg); padding: clamp(34px,5vw,60px);
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(107,255,91,.18), transparent 60%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-2); text-align: center;
}
.band h2 { font-size: clamp(26px,4vw,42px); letter-spacing: -.03em; }
.band p { color: var(--ink-2); margin: 12px auto 26px; max-width: 50ch; }

/* ---------- footer ---------- */
.ftr { border-top: 1px solid var(--line); padding: 54px 0 40px; color: var(--ink-3); }
.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:hover { color: var(--acid); }
.ftr .bottom { margin-top: 40px; padding-top: 22px; border-top: 1px dashed var(--line); display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; font-family: var(--mono); font-size: 12px; }

/* ---------- playground ---------- */
.pg-head { padding: clamp(48px,7vw,90px) 0 22px; }
.lab-grid { display:grid; grid-template-columns: repeat(2,1fr); gap: var(--gap); }
@media (max-width: 900px){ .lab-grid { grid-template-columns: 1fr; } }
.lab {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; display:flex; flex-direction:column;
}
.lab .tag { display:inline-flex; align-items:center; gap:8px; font-family:var(--mono); font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--acid); border:1px solid var(--line-2); border-radius:100px; padding:5px 11px; align-self:flex-start; }
.lab h3 { margin: 14px 0 4px; font-size: 21px; }
.lab .meth { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.lab label { display:block; font-size: 13px; color: var(--ink-2); margin: 14px 0 6px; }
.lab input[type=text], .lab textarea, .lab input[type=number] {
  width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 11px 13px; font-family: var(--mono); font-size: 13px;
}
.lab input::file-selector-button { font:inherit; background: rgba(107,255,91,.12); color: var(--acid); border:1px solid var(--line-2); border-radius: var(--r); padding: 8px 12px; margin-right: 12px; cursor:pointer; }
.lab textarea { resize: vertical; min-height: 70px; }
.lab .row { display:flex; gap: 10px; }
.lab .row > * { flex: 1; }
.lab .actions { margin-top: 16px; display:flex; gap:10px; align-items:center; }
.lab .out {
  margin-top: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--mono); font-size: 12.5px; padding: 14px; min-height: 56px; white-space: pre-wrap;
  color: var(--ink-2); overflow-x:auto;
}
.lab .out .ok { color: var(--acid); }
.lab .out .no { color: var(--stamp); }
.lab .out .pend { color: var(--gold); }
#fnfd-widget-mount { margin-top: 4px; }
#fnfd-widget-mount input { width:100%; background:var(--bg); color:var(--ink); border:1px solid var(--line-2); border-radius:var(--r); padding:11px 13px; font-family:var(--mono); font-size:13px; margin:6px 0; }
#fnfd-widget-mount button { margin-top:6px; background:var(--acid); color:var(--acid-ink); font-weight:700; padding:11px 18px; border-radius:var(--r); }
#fnfd-widget-mount code { color: var(--acid); }

.note { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.kbd { font-family:var(--mono); background: rgba(107,255,91,.1); border:1px solid var(--line); border-radius:4px; padding:1px 6px; color: var(--acid); font-size: 12px; }

/* reveal on load */
.reveal { opacity: 0; transform: translateY(16px); animation: rise .7s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
