:root {
  --bg: #F3ECE3;
  --card: #FFFDFA;
  --ink: #2A2320;
  --muted: #8A7E75;
  --bronze: #9A7453;
  --bronze-2: #6E5139;
  --line: #E6DCCF;
  --good: #3FA37A;
  --focus: #E0A43B;
  --prio: #D9667A;
  --r: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 Manrope, system-ui, sans-serif; }
body { max-width: 520px; margin: 0 auto; min-height: 100dvh; overflow-x: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
h1, h2, h3 { font-family: 'Cormorant Garamond', serif; font-weight: 600; letter-spacing: -.01em; margin: 0; }
img { display: block; max-width: 100%; }

/* ── главная ── */
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.logo { height: 44px; width: auto; }
.logo.sm { height: 30px; margin: 0 auto 8px; opacity: .8; }
.since { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--bronze); }
.hero { padding: 26px 20px 8px; }
.eyebrow { margin: 0 0 12px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hero h1 { font-size: 44px; line-height: 1.02; }
.hero h1 em { font-style: italic; color: var(--bronze); }
.lead { margin: 14px 0 22px; color: var(--muted); font-size: 15px; }

.scan-card { position: relative; display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px; border-radius: 28px; color: #fff; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, #C9A27E 0%, #9A7453 45%, #5B412D 100%);
  box-shadow: 0 22px 40px -18px rgba(90, 60, 35, .7); }
.scan-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%); background-size: 250% 100%; animation: sheen 3.2s ease-in-out infinite; }
@keyframes sheen { 0% { background-position: 120% 0 } 60%, 100% { background-position: -120% 0 } }
.scan-face { width: 96px; height: 120px; }
.scan-face svg { width: 100%; height: 100%; }
.scanline { animation: scan 2.4s ease-in-out infinite; filter: drop-shadow(0 0 6px #fff); }
@keyframes scan { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(108px) } }
.scan-text b { display: block; font-size: 19px; font-weight: 800; line-height: 1.15; }
.scan-text small { display: block; margin-top: 6px; font-size: 12.5px; opacity: .85; }
.scan-go { grid-column: 1 / -1; justify-self: stretch; text-align: center; padding: 13px; border-radius: 16px; background: #fff; color: var(--bronze-2); font-weight: 800; }

.brands { margin: 26px 0 6px; border-block: 1px solid var(--line); overflow: hidden; }
.track { display: flex; gap: 34px; width: max-content; padding: 14px 0; animation: marquee 26s linear infinite; }
.track span { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 700; letter-spacing: .08em; color: var(--bronze-2); white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%) } }

.numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 18px 20px; }
.numbers div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.numbers b { display: block; font-family: 'Cormorant Garamond', serif; font-size: 36px; line-height: 1; color: var(--bronze-2); }
.numbers span { font-size: 13px; color: var(--muted); }

.where { padding: 10px 20px 8px; }
.where h2 { font-size: 30px; margin-bottom: 12px; }
.buy { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 10px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); color: inherit; text-decoration: none; }
.buy b { display: block; }
.buy small { color: var(--muted); font-size: 13px; }
.buy i { margin-left: auto; font-style: normal; font-size: 26px; color: var(--muted); }
.buy-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; font-weight: 800; color: #fff; flex: none; }
.kaspi { background: #F14635; }
.riori { background: linear-gradient(135deg, #E88AA5, #B8577A); font-size: 14px; }
.foot { padding: 26px 20px calc(30px + var(--safe-b)); text-align: center; font-size: 12.5px; color: var(--muted); }
.foot p { margin: 4px 0; }
.foot .demo { opacity: .7; }

/* ── приложение ── */
#app { position: fixed; inset: 0; z-index: 10; background: var(--bg); display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; }
#app[hidden] { display: none; }
.bar { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 8px; }
.back, .close { width: 40px; height: 40px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); font-size: 22px; line-height: 1; }
.close { font-size: 15px; }
.progress { flex: 1; height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #C9A27E, var(--bronze-2)); transition: width .5s ease; }
#screen { flex: 1; overflow-y: auto; padding: 8px 20px calc(24px + var(--safe-b)); animation: in .45s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(14px) } }

.q-title { font-size: 34px; line-height: 1.05; margin: 10px 0 8px; }
.q-sub { color: var(--muted); margin: 0 0 18px; font-size: 14.5px; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: 20px; background: var(--card); border: 1.5px solid var(--line); text-align: left; transition: transform .15s, border-color .2s, background .2s; }
.opt:active { transform: scale(.98); }
.opt.on { border-color: var(--bronze); background: #FBF4EC; box-shadow: 0 8px 22px -14px rgba(110, 81, 57, .8); }
.opt .ico { font-size: 26px; width: 36px; text-align: center; }
.opt b { display: block; font-size: 15.5px; }
.opt small { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { padding: 12px 16px; border-radius: 40px; background: var(--card); border: 1.5px solid var(--line); font-weight: 600; font-size: 14.5px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cta { display: block; width: 100%; margin-top: 22px; padding: 17px; border-radius: 18px; background: var(--ink); color: #fff; font-weight: 800; font-size: 16px; text-align: center; }
.cta:disabled { opacity: .35; }
.cta.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); margin-top: 10px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 13px; color: var(--muted); }
.consent input { width: 20px; height: 20px; accent-color: var(--bronze); margin-top: 1px; flex: none; }
.switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); margin: 16px 0 4px; }
.switch button { padding: 12px; border-radius: 14px; font-weight: 700; }
.switch button.on { background: var(--ink); color: #fff; }

/* камера */
.cam { position: relative; margin: 6px -20px 0; aspect-ratio: 3 / 4; background: #1b1512; overflow: hidden; border-radius: 0 0 30px 30px; }
.cam canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam .oval { position: absolute; left: 50%; top: 47%; width: 64%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%); border-radius: 50%; border: 2px dashed rgba(255,255,255,.55); transition: border-color .3s, box-shadow .3s; }
.cam .oval.ok { border: 2.5px solid #7FE3B7; box-shadow: 0 0 0 999px rgba(20, 14, 10, .35), 0 0 30px rgba(127, 227, 183, .6); }
.cam .oval:not(.ok) { box-shadow: 0 0 0 999px rgba(20, 14, 10, .45); }
.hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 10px 16px; border-radius: 30px; background: rgba(20,14,10,.72); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; backdrop-filter: blur(8px); }
.ring { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.checks { display: flex; justify-content: center; gap: 8px; margin: 14px 0 0; flex-wrap: wrap; }
.checks span { padding: 7px 12px; border-radius: 30px; background: var(--card); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.checks span.ok { color: var(--good); border-color: #BFE3D1; background: #F1FAF5; }
.upload { display: block; text-align: center; margin-top: 12px; color: var(--bronze-2); font-weight: 700; font-size: 14px; }

/* анализ */
.scanwrap { position: relative; margin: 6px -20px 0; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 0 0 30px 30px; background: #1b1512; }
.scanwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.scanbeam { position: absolute; left: 0; right: 0; height: 90px; top: -90px; background: linear-gradient(180deg, transparent, rgba(255, 230, 205, .45), transparent); animation: beam 1.6s ease-in-out infinite; }
@keyframes beam { to { top: 100% } }
.status { text-align: center; margin: 18px 0 0; }
.status b { font-family: 'Cormorant Garamond', serif; font-size: 28px; }
.status p { margin: 4px 0 0; color: var(--muted); font-size: 14px; min-height: 20px; }

/* результат */
.res-photo { position: relative; margin: 6px -20px 0; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 0 0 30px 30px; background: #1b1512; }
.res-photo canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.res-index { position: absolute; left: 16px; bottom: 16px; padding: 12px 16px; border-radius: 20px; background: rgba(255, 253, 250, .92); backdrop-filter: blur(10px); }
.res-index b { font-family: 'Cormorant Garamond', serif; font-size: 44px; line-height: .9; color: var(--bronze-2); }
.res-index small { display: block; font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 12px; justify-content: center; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.type { margin: 18px 0 4px; font-size: 32px; }
.type em { font-style: italic; color: var(--bronze); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-top: 14px; }
.radar { display: block; width: 100%; max-width: 320px; margin: 0 auto; }
.bars { display: grid; gap: 10px; }
.bars div { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13.5px; }
.bars u { grid-column: 1 / -1; display: block; height: 7px; border-radius: 7px; background: var(--line); overflow: hidden; text-decoration: none; }
.bars u i { display: block; height: 100%; border-radius: 7px; width: 0; transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); margin: 22px 0 12px; }
.tabs button { padding: 12px; border-radius: 14px; font-weight: 700; }
.tabs button.on { background: var(--ink); color: #fff; }
.step { display: grid; grid-template-columns: 26px 88px 1fr; gap: 12px; align-items: center; padding: 12px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); margin-bottom: 10px; animation: in .4s ease both; }
.step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; }
.step img { width: 88px; height: 88px; border-radius: 16px; object-fit: cover; background: #EFE7DD; }
.step .kind { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.step b { display: block; font-size: 14.5px; line-height: 1.2; margin: 2px 0; }
.step .ru { font-size: 12.5px; color: var(--muted); }
.step .why { margin-top: 6px; font-size: 12.5px; color: var(--bronze-2); font-weight: 600; }
.line-tag { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.note { font-size: 12px; color: var(--muted); margin-top: 16px; text-align: center; }
.bonus { background: linear-gradient(135deg, #2A2320, #4A3A2F); color: #fff; border: 0; }
.bonus h3 { font-size: 26px; }
.bonus p { color: rgba(255,255,255,.75); font-size: 14px; margin: 6px 0 14px; }
.bonus .chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
.bonus .chip.on { background: #fff; color: var(--ink); }
.hair-res { margin-top: 14px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.1); }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.share-row a, .share-row button { display: block; padding: 14px; border-radius: 16px; text-align: center; font-weight: 800; text-decoration: none; color: #fff; }
.wa { background: #1FAF5A; }
.save { background: var(--bronze-2); }

/* кнопка снимка и загрузчик */
.shutter { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); width: 68px; height: 68px; border-radius: 50%; border: 4px solid rgba(255,255,255,.85); background: rgba(255,255,255,.18); backdrop-filter: blur(6px); }
.shutter i { position: absolute; inset: 6px; border-radius: 50%; background: #fff; transition: transform .15s; }
.shutter:active i { transform: scale(.86); }
.cam .hint { bottom: 150px; }
.loader { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20,14,10,.35); }
.loader i { width: 56px; height: 56px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.status a { color: var(--bronze-2); font-weight: 700; }

/* ── анимации ── */
@keyframes up { from { opacity: 0; transform: translateY(18px) } }
@keyframes pop { 0% { opacity: 0; transform: scale(.6) } 70% { transform: scale(1.06) } 100% { opacity: 1; transform: scale(1) } }
@keyframes slideL { from { opacity: 0; transform: translateX(34px) } }
@keyframes slideR { from { opacity: 0; transform: translateX(-34px) } }
@keyframes breathe { 0%, 100% { box-shadow: 0 22px 40px -18px rgba(90, 60, 35, .7) } 50% { box-shadow: 0 26px 54px -14px rgba(154, 116, 83, .85) } }
.top, .hero > *, .brands, .numbers > div, .where > * { animation: up .8s cubic-bezier(.2, .8, .2, 1) both; }
.top { animation-delay: .05s } .hero > :nth-child(1) { animation-delay: .12s } .hero > :nth-child(2) { animation-delay: .2s }
.hero > :nth-child(3) { animation-delay: .28s } .hero > :nth-child(4) { animation-delay: .38s } .brands { animation-delay: .5s }
.numbers > div:nth-child(1) { animation-delay: .55s } .numbers > div:nth-child(2) { animation-delay: .62s } .numbers > div:nth-child(3) { animation-delay: .69s } .numbers > div:nth-child(4) { animation-delay: .76s }
.scan-card { animation: up .8s .38s cubic-bezier(.2, .8, .2, 1) both, breathe 3.4s 1.4s ease-in-out infinite; }
.scan-card:active { transform: scale(.98); }
#screen.fwd { animation: slideL .45s cubic-bezier(.2, .8, .2, 1) both; }
#screen.bwd { animation: slideR .45s cubic-bezier(.2, .8, .2, 1) both; }
.opt, .chip { animation: up .5s cubic-bezier(.2, .8, .2, 1) both; }
.opts > :nth-child(2), .chips > :nth-child(2) { animation-delay: .05s } .opts > :nth-child(3), .chips > :nth-child(3) { animation-delay: .1s }
.opts > :nth-child(4), .chips > :nth-child(4) { animation-delay: .15s } .chips > :nth-child(5) { animation-delay: .2s } .chips > :nth-child(6) { animation-delay: .25s }
.opt.on .ico { animation: pop .4s both; }
.cta:not(:disabled):active, .chip:active { transform: scale(.97); }

/* загрузка нейросети в овале */
.mload { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); width: 128px; height: 128px; display: grid; place-items: center; color: #fff; transition: opacity .4s; }
.mload svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.mload circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.mload .bg { stroke: rgba(255,255,255,.18); }
.mload .fg { stroke: #F1D9C0; transition: stroke-dashoffset .3s; filter: drop-shadow(0 0 6px rgba(241, 217, 192, .8)); }
.mload b { font: 700 26px Manrope; }
.mload small { position: absolute; top: 136px; white-space: nowrap; font-size: 12.5px; opacity: .85; }
.mload.done { opacity: 0; pointer-events: none; }

/* анализ: список шагов */
.steps-live { list-style: none; padding: 0; margin: 14px auto 0; max-width: 300px; }
.steps-live li { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--muted); font-size: 14px; opacity: .35; transition: opacity .3s, color .3s; }
.steps-live li i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 12px; flex: none; }
.steps-live li.on { opacity: 1; color: var(--ink); }
.steps-live li.on i { border-color: var(--bronze); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps-live li.ok { opacity: 1; color: var(--ink); }
.steps-live li.ok i { border-color: var(--good); background: var(--good); color: #fff; animation: pop .35s both; }
.counter { font-family: 'Cormorant Garamond', serif; font-size: 22px; color: var(--bronze-2); }

/* результат */
.res-index { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; animation: pop .7s .3s both; }
.gauge { position: relative; width: 74px; height: 74px; }
.gauge svg { transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.gauge .fg { transition: stroke-dashoffset 1.5s cubic-bezier(.2, .8, .2, 1); }
.gauge b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px !important; }
.seen { margin: 16px 0 0; }
.seen small { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.seen div { display: flex; flex-wrap: wrap; gap: 8px; }
.seen span { padding: 8px 13px; border-radius: 30px; background: #FFF1EE; color: #A84A5A; font-size: 13.5px; font-weight: 700; animation: pop .45s both; }
.seen.ok span { background: #EEF8F3; color: var(--good); }
.res-photo canvas { animation: up .7s both; }
#routine .step { animation: slideL .5s cubic-bezier(.2, .8, .2, 1) both; }
.scanwrap { aspect-ratio: 1 / 1.08; }
.scanwrap canvas { object-fit: cover; }
.res-index { top: 14px; bottom: auto; left: 14px; }
