/* IDEA    воронка как ботанический экземпляр: венчик ипомеи воронковидный и пятидольный (3–5 партнёров)
   PICTURE живой 3D-цветок; скролл ведёт по нему скан-линию сетки (scroll-mesh-survey)
   COLOUR  ночная зелень, лишайник, ипомея-синий; лайм только у скана и действий
   TYPE    Geologica 300 (светлый геометрический гротеск с кириллицей; у Lexend её нет)
   LAYOUT  sylva-field-guide: общие поля, сквозные вертикали, редкие диагонали, подписи по двум краям */
@font-face { font-family: Geologica; src: url(fonts/geologica-cyrillic.woff2) format('woff2'); font-weight: 200 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Geologica; src: url(fonts/geologica-latin.woff2) format('woff2'); font-weight: 200 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }

:root {
  --night: #0e1f19;
  --night-ink: #eaf0dc;
  --paper: #e6ebd6;
  --ink: #13251d;
  --moss: #b9c9a3;
  --bloom: #343fcf;
  --scan: #d9fb93;
  --inset: clamp(22px, 5vw, 88px);
  --rule: color-mix(in srgb, currentColor 16%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); font: 300 17px/1.6 Geologica, 'Segoe UI', sans-serif; overflow-x: clip; }
a { color: inherit; }
a, button, label { touch-action: manipulation; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }
h1, h2, h3 { margin: 0; font-weight: 250; text-wrap: balance; }
h1 { font-size: clamp(2.9rem, 4.9vw, 5.8rem); line-height: 1; letter-spacing: -.05em; }
h1 span { display: block; }
h2 { font-size: clamp(2.1rem, 4.5vw, 4.6rem); line-height: 1.04; letter-spacing: -.045em; }
h3 { font-size: clamp(1.6rem, 2.7vw, 2.7rem); line-height: 1.1; letter-spacing: -.035em; }
p { margin: 0; max-width: 46ch; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
.nw { white-space: nowrap; }
.skip { position: absolute; left: -999px; z-index: 20; padding: 12px 18px; background: var(--scan); color: var(--ink); }
.skip:focus { left: 12px; top: 12px; }

.night { background: var(--night); color: var(--night-ink); font-weight: 260; }
.paper { background: var(--paper); }
.moss { background: var(--moss); }
.bloom { background: var(--bloom); color: #fff; font-weight: 270; }

/* Сквозные вертикали: отдельный слой, чуть снаружи полей */
.shell { position: relative; width: 100%; max-width: 1520px; margin-inline: auto; padding-inline: var(--inset); }
.shell::before { content: ''; position: absolute; inset-block: 0; inset-inline: calc(var(--inset) * .72); border-inline: 1px solid currentColor; opacity: .14; pointer-events: none; }
.block { padding-block: clamp(72px, 10vw, 160px); }
.block:has(> .cap:last-child) { padding-bottom: 0; }
.cap { position: relative; display: flex; justify-content: space-between; gap: 8px 24px; max-width: none; padding-block: 18px; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.45; }
.cap span:last-child, .cap a { text-align: right; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 12px 26px; border: 0; border-radius: 27px; background: var(--scan); color: #10210f; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; transition: background .2s var(--ease), transform .2s var(--ease); }
.btn:hover { background: #fff; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: progress; }
.link { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: .35em; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); transition: text-decoration-color .2s; }
.link:hover { text-decoration-color: currentColor; }

/* Сцена: закреплённый цветок, текст проходит рядом */
.stage { position: relative; }
.track { position: absolute; inset: 0; }
.world { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: radial-gradient(ellipse 60% 70% at 70% 48%, #24463a, transparent 75%); }
.world canvas { display: block; width: 100%; height: 100%; }
.callout { position: absolute; left: 0; top: 0; right: calc(max(0px, (100% - 1520px) / 2) + var(--inset) * .72); height: 1px; opacity: 0; transition: opacity .3s; }
.callout::before { content: ''; position: absolute; inset: 0 0 0 var(--from, 60%); background: linear-gradient(90deg, transparent, var(--scan) 12%); }
.callout span { position: absolute; right: 0; bottom: 0; padding: 5px 14px; border-radius: 8px 8px 0 0; background: #0e1f19d9; font-size: 15px; color: var(--scan); }
.callout.on { opacity: 1; }
.bar::before { display: none; }
.bar { position: absolute; inset: 0 0 auto; z-index: 4; display: flex; align-items: center; gap: 24px; height: 84px; }
.brand { margin-right: auto; font-size: 24px; font-weight: 400; letter-spacing: -.04em; text-decoration: none; }
.bar nav { display: flex; gap: 8px; }
.bar nav a, .pill { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 14px; border-radius: 22px; font-size: 15px; text-decoration: none; transition: background .2s; }
.bar nav a:hover { background: #ffffff14; }
.pill { border: 1px solid #ffffff4d; padding-inline: 18px; }
.pill:hover { background: #ffffff1f; }
main { position: relative; z-index: 1; pointer-events: none; }
main a { pointer-events: auto; }
main p, main h1, main h2, main h3, .knobs, .result { pointer-events: auto; }
.hero { display: grid; grid-template-rows: 1fr auto; min-height: 100vh; min-height: 100svh; padding-top: 84px; }
.hero .copy { align-self: center; width: min(58%, 800px); padding-block: 32px; }
.lead { margin-top: 1.5em; font-size: clamp(17px, 1.35vw, 21px); max-width: 38ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 30px; margin-top: 36px; }
.survey .step { display: grid; align-content: center; gap: 22px; width: min(40%, 560px); min-height: 88vh; min-height: 88svh; }
.survey .intro { min-height: 70vh; min-height: 70svh; }
.survey article { opacity: .62; transition: opacity .35s var(--ease); }
.survey article.on { opacity: 1; }

/* Калькулятор */
.calc { display: grid; align-items: center; min-height: 100vh; min-height: 100svh; padding-block: 48px; }
.calc h2 { font-size: clamp(2.1rem, 2.6vw, 2.9rem); }
.panel { width: min(47%, 680px); }
.panel > p { margin-top: 14px; }
.knobs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 36px; margin-top: 26px; }
.knob { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0 12px; }
.knob label { font-size: 15px; line-height: 1.3; }
.val { display: flex; align-items: baseline; gap: 5px; font-size: 19px; font-weight: 400; white-space: nowrap; }
.val input { width: 5.4em; min-height: 36px; padding: 2px 4px; border: 0; border-bottom: 1px solid #ffffff59; border-radius: 0; background: none; color: inherit; font: inherit; text-align: right; font-variant-numeric: tabular-nums; }
.val input:hover { border-color: #fff; }
.val input:focus { outline: 2px solid var(--scan); outline-offset: 2px; border-radius: 3px; }
.knob [type=range] { grid-column: 1 / -1; width: 100%; height: 44px; margin: 0; appearance: none; background: none; cursor: grab; }
.knob [type=range]:active { cursor: grabbing; }
.knob [type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--scan) var(--fill), #ffffff3d var(--fill)); }
.knob [type=range]::-moz-range-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--scan) var(--fill), #ffffff3d var(--fill)); }
.knob [type=range]::-webkit-slider-thumb { appearance: none; width: 24px; height: 24px; margin-top: -10.5px; border: 5px solid var(--night); border-radius: 50%; background: var(--scan); box-shadow: 0 0 0 1px var(--scan); transition: transform .2s var(--ease); }
.knob [type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 5px solid var(--night); border-radius: 50%; background: var(--scan); box-shadow: 0 0 0 1px var(--scan); }
.knob [type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }
.result { --us: #8f98ff; --ad: #7f9a83; margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--rule); }
.result.loss { --yours: #ff9a80; }
.sum { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; max-width: none; }
.sum output { font-size: clamp(2.2rem, 3.6vw, 3.5rem); font-weight: 250; line-height: 1.1; letter-spacing: -.04em; color: var(--yours, var(--scan)); white-space: nowrap; }
.split { display: flex; gap: 3px; height: 14px; margin-top: 14px; }
.split i { flex: 0 1 0; transition: flex-grow .35s var(--ease); }
.split .ads, .legend .ads::before { background: var(--ad); }
.split .ours, .legend .ours::before { background: var(--us); }
.split .yours, .legend .yours::before { background: var(--yours, var(--scan)); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0; }
.legend li { display: flex; align-items: baseline; gap: 8px; font-size: 15px; white-space: nowrap; }
.legend li::before { content: ''; width: 10px; height: 10px; }
.legend b { font-weight: 500; font-variant-numeric: tabular-nums; }
.result .actions { margin: 20px 0 16px; }

/* Лепестки */
.petal .edge { fill: #fff; fill-opacity: 0; stroke: #fff; stroke-opacity: .75; stroke-width: 1.6; stroke-dasharray: 5 8; transition: fill-opacity .5s var(--ease), fill .5s; }
.petal .mesh { fill: none; stroke: #fff; stroke-opacity: .16; transition: stroke-opacity .5s; }
.petal.full .edge { fill-opacity: .17; stroke-dasharray: none; }
.petal.full .mesh { stroke-opacity: .34; }
.rosette circle, .asking circle { fill: var(--scan); }
.asking { display: block; width: min(100%, 360px); margin-top: 48px; }
.asking .petal { transform: scale(.74); transition: transform .7s cubic-bezier(.2, 1.3, .4, 1); }
.asking .petal.full { transform: none; }
.asking .petal.now .edge { stroke: var(--scan); stroke-opacity: 1; stroke-width: 4; }
.asking .petal.full .edge { fill: var(--bloom); fill-opacity: 1; }
.asking circle { transform: scale(.6); transition: transform .7s cubic-bezier(.2, 1.3, .4, 1); }
.asking.done circle { transform: scale(1.15); }

/* Условия */
.head { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px 6vw; align-items: end; }
.terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: clamp(56px, 8vw, 120px) 0 clamp(40px, 5vw, 72px); }
.terms > div { padding: 0 24px 8px; border-left: 1px solid var(--rule); }
.terms > div:first-child { padding-left: 0; border: 0; }
.terms dt { display: flex; align-items: flex-end; height: calc(clamp(3.4rem, 8vw, 8rem) * 1.15); font-size: clamp(3.4rem, 8vw, 8rem); font-weight: 250; line-height: 1; letter-spacing: -.06em; color: var(--bloom); }
.terms > div:nth-child(2) dt { font-size: clamp(2.6rem, 5.6vw, 5.8rem); line-height: 1.25; }
.terms dd { margin: 24px 0 0; max-width: 30ch; }
.terms strong { display: block; font-weight: 500; font-size: 20px; line-height: 1.3; margin-bottom: 6px; }

/* Сравнение */
.duo { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px 6vw; align-items: center; }
.duo .copy > p { margin-top: 28px; }
.duo .copy > .sub { margin: 44px 0 10px; font-weight: 500; }
.rules li { padding-block: 15px; border-top: 1px solid var(--rule); }
.rules li:last-child { border-bottom: 1px solid var(--rule); }
.pair { position: relative; margin: 0; }
.pair svg { display: block; width: 100%; height: auto; overflow: visible; }
.pair figcaption { display: grid; grid-template-columns: 1fr 1fr; text-align: center; padding-top: 18px; border-top: 1px solid var(--ink); font-weight: 500; }

/* Пять долей */
.bloom { position: relative; overflow: hidden; }
.bloom .block { display: grid; grid-template-rows: 1fr auto; min-height: min(100svh, 980px); }
.bloom .copy { align-self: center; width: min(48%, 640px); }
.bloom .copy p { margin-top: 28px; font-size: clamp(17px, 1.35vw, 20px); }
.rosette { position: absolute; top: calc(50% - 28px); right: max(2vw, (100vw - 1520px) / 2); width: min(50vw, 800px); aspect-ratio: 1; transform: translateY(-50%); }

/* Кому подойдёт */
.fit { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px 6vw; margin-top: clamp(48px, 6vw, 88px); }
.fit h3 { margin-bottom: 24px; }
.fit li { position: relative; padding-left: 40px; font-size: 18px; }
.fit li::before, .fit li::after { content: ''; position: absolute; left: 2px; top: 28px; background: currentColor; }
.yes li::before { width: 18px; height: 9px; background: none; border: solid var(--bloom); border-width: 0 0 2px 2px; transform: translateY(-5px) rotate(-45deg); }
.yes li::after { display: none; }
.no li::before { width: 18px; height: 2px; opacity: .7; }
.no li::after { display: none; }

/* Форма */
#contact .duo { align-items: start; }
form { display: grid; gap: 22px; align-content: start; }
[hidden] { display: none !important; }
.progress { color: var(--scan); }
.q { display: grid; gap: 20px; align-content: start; min-height: 290px; animation: rise .4s var(--ease); }
.q h3:focus, .sent:focus { outline: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.pair-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.attach { display: flex; gap: 12px; font-size: 15px; line-height: 1.5; cursor: pointer; }
.attach input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--scan); }
.attach b { font-weight: 400; color: var(--scan); }
label { font-size: 16px; }
.field { display: grid; gap: 8px; align-content: start; }
.field input, textarea { width: 100%; min-height: 54px; padding: 13px 16px; border: 1px solid #ffffff59; border-radius: 8px; background: #ffffff0d; color: inherit; font: inherit; transition: border-color .2s, background .2s; }
textarea { resize: vertical; }
.field input:hover, textarea:hover { border-color: #ffffff8c; }
.field input:focus, textarea:focus { outline: 2px solid var(--scan); outline-offset: 1px; background: #ffffff14; }
[aria-invalid=true] { border-color: #ffb09a !important; }
.hint { font-size: 14px; line-height: 1.5; max-width: none; color: #eaf0dcc4; }
.err { font-size: 14px; color: #ffb09a; max-width: none; }
.err:empty { display: none; }
.opts { display: flex; flex-wrap: wrap; gap: 10px; }
.opts label { position: relative; cursor: pointer; }
.opts input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.opts span { display: flex; align-items: center; min-height: 46px; padding: 8px 18px; border: 1px solid #ffffff59; border-radius: 23px; line-height: 1.25; transition: background .2s, color .2s; }
.opts label:hover span { background: #ffffff14; }
.opts input:checked + span { background: var(--night-ink); border-color: var(--night-ink); color: var(--ink); }
.opts input:focus-visible + span { outline: 2px solid var(--scan); outline-offset: 3px; }
.trap { position: absolute; left: -9999px; }
#back { order: 1; padding: 0 4px; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
#status { order: 2; }
.send { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
.sent { display: grid; gap: 14px; padding-block: 40px; border-block: 1px solid var(--rule); }

@media (min-width: 801px) and (max-width: 1250px) {
  .knobs { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

@media (max-width: 1000px) {
  .bar nav { display: none; }
}

@media (max-width: 800px) {
  .bar { height: 68px; }
  .pill { font-size: 14px; padding-inline: 14px; }
  /* Цветок закреплён сверху, текст уходит под него */
  .track { display: contents; }
  .world { z-index: 2; height: 46vh; height: 46svh; background: radial-gradient(ellipse 80% 75% at 50% 55%, #24463a, var(--night) 85%); }
  .world::after { content: ''; position: absolute; inset: auto 0 0; height: 36px; background: linear-gradient(transparent, var(--night)); }
  .hero { min-height: 54vh; min-height: 54svh; padding-top: 0; }
  .hero .copy { width: 100%; padding-block: 8px 32px; align-self: start; }
  h1 { font-size: clamp(1.9rem, 10vw, 4rem); }
  .actions { margin-top: 26px; }
  .hero .fig, .bloom .cap span:first-child { display: none; }
  .bloom .cap { margin-top: 36px; }
  .bloom .cap span:last-child { text-align: left; }
  .survey .step { width: 100%; min-height: 54vh; min-height: 54svh; align-content: start; padding-top: 44px; gap: 16px; }
  .survey .step:last-child { padding-bottom: 0; }
  .survey, .calc { scroll-margin-top: 46vh; scroll-margin-top: 46svh; }
  .callout span { padding: 4px 10px; font-size: 13px; }
  .calc { min-height: 0; padding-block: 44px 56px; }
  .panel { width: 100%; }
  .asking { width: min(44vw, 200px); margin-top: 28px; }
  .q { min-height: 250px; }
  .head, .duo, .fit { grid-template-columns: minmax(0, 1fr); }
  .terms { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .terms > div, .terms > div:first-child { padding: 24px 0 0; border: 0; border-top: 1px solid var(--rule); }
  .terms dt, .terms > div:nth-child(2) dt { height: auto; font-size: 4rem; }
  .terms dd { margin-top: 12px; }
  .bloom .block { min-height: 0; padding-top: 72px; }
  .bloom .copy { width: 100%; }
  .rosette { position: relative; top: 0; right: 0; display: block; width: min(88vw, 560px); margin: 48px auto -24px; transform: none; }
  .bloom { display: flex; flex-direction: column; }
}

@media (max-width: 370px) {
  .pill span { display: none; }
}

@media (max-width: 520px) {
  .pair-fields, .knobs { grid-template-columns: minmax(0, 1fr); }
  .knobs { gap: 12px; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, ::before, ::after { transition: none !important; animation: none !important; }
}
