@import url('/assets/fonts.css');

/* Whellsy: те же токены, что в приложении (DesignSystem/Tokens). */
:root {
  --violet: oklch(0.58 0.24 283);      /* #6B5BFF */
  --violet-end: oklch(0.66 0.16 300);  /* #9F7AEA */
  --teal: oklch(0.79 0.11 182);        /* #4FD1C5 */
  --amber: oklch(0.72 0.19 50);        /* #FF7A18 */
  --coral: oklch(0.67 0.21 12);        /* #FF4D6D */

  --bg-top: oklch(0.995 0.003 300);
  --bg-mid: oklch(0.975 0.012 295);
  --bg-end: oklch(0.975 0.018 60);
  --ink: oklch(0.22 0.02 290);
  --ink-soft: oklch(0.48 0.02 290);
  --line: oklch(0.88 0.015 290 / 0.7);
  --glass: oklch(0.995 0.004 300 / 0.72);
  --glass-line: oklch(0.7 0.01 290 / 0.14);

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 32px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-top: oklch(0.16 0.006 290);
    --bg-mid: oklch(0.19 0.014 290);
    --bg-end: oklch(0.16 0.016 320);
    --ink: oklch(0.95 0.006 290);
    --ink-soft: oklch(0.72 0.014 290);
    --line: oklch(0.4 0.02 290 / 0.6);
    --glass: oklch(0.22 0.01 290 / 0.78);
    --glass-line: oklch(0.95 0.01 290 / 0.08);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; -webkit-tap-highlight-color: oklch(0.58 0.24 283 / 0.15); }
a, button, summary { touch-action: manipulation; }
h1, h2, h3 { text-wrap: balance; }
body {
  margin: 0;
  font-family: 'Onest', -apple-system, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-end) 100%);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--violet); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
@media (prefers-color-scheme: dark) { a { color: oklch(0.76 0.13 290); } }
a:focus-visible, button:focus-visible { outline: 2.5px solid var(--violet); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--glass); padding: 8px 14px; border-radius: var(--radius-s); z-index: 10; }
.skip:focus { left: 12px; }

/* ---------- Шапка ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(1120px, 100% - 40px); margin: 0 auto; padding: 22px 0;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 20px; letter-spacing: -0.01em; }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 2px 8px oklch(0.4 0.1 285 / 0.18); }
.top nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 15px; font-weight: 550;
  padding: 8px 12px; border-radius: 999px;
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.top nav a:hover { color: var(--ink); background: var(--glass); }
.top nav a[aria-current="page"] { color: var(--ink); }
.top nav .lang { border: 1px solid var(--line); margin-left: 6px; }

main { flex: 1; }

/* ---------- Главная: герой ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  width: min(1120px, 100% - 24px); margin: 8px auto 0;
  border-radius: var(--radius-l);
  padding: clamp(40px, 8vw, 96px) clamp(24px, 6vw, 80px) clamp(56px, 9vw, 112px);
  background: var(--violet);
  color: oklch(0.985 0.01 290);
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 5vw, 64px); align-items: center;
}
.hero::after { /* лёгкий шум поверх цвета, чтобы заливка не была плоской */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.orbs { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(48px); opacity: .85; will-change: transform; }
.orb.a { width: 44vmax; height: 44vmax; max-width: 560px; max-height: 560px; right: -12%; top: -30%; background: var(--violet-end); animation: drift-a 18s var(--ease) infinite alternate; }
.orb.b { width: 26vmax; height: 26vmax; max-width: 340px; max-height: 340px; right: 8%; bottom: -28%; background: var(--amber); opacity: .55; animation: drift-b 22s var(--ease) infinite alternate; }
.orb.c { width: 20vmax; height: 20vmax; max-width: 260px; max-height: 260px; left: -6%; bottom: -18%; background: var(--teal); opacity: .45; animation: drift-c 26s var(--ease) infinite alternate; }
@keyframes drift-a { to { transform: translate(-8%, 10%) scale(1.08); } }
@keyframes drift-b { to { transform: translate(-14%, -12%) scale(.92); } }
@keyframes drift-c { to { transform: translate(18%, -10%) scale(1.12); } }

.hero h1 {
  font-size: clamp(40px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800;
  margin: 0 0 22px; text-wrap: balance;
}
.hero .lede { font-size: clamp(18px, 1.9vw, 21px); line-height: 1.5; max-width: 34ch; margin: 0 0 34px; color: oklch(0.96 0.02 290); }
.store {
  display: inline-flex; align-items: center; gap: 12px;
  background: oklch(0.99 0.004 290); color: oklch(0.2 0.03 285); text-decoration: none;
  padding: 14px 22px 14px 18px; border-radius: 16px; font-weight: 650; font-size: 16px; line-height: 1.15;
  box-shadow: 0 10px 30px -10px oklch(0.2 0.1 285 / 0.5);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.store svg { width: 26px; height: 26px; flex: none; }
.store small { display: block; font-size: 12px; font-weight: 500; opacity: .7; }
.store:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px oklch(0.2 0.1 285 / 0.6); }
.store:active { transform: translateY(0) scale(.98); }
.hero .note { margin: 16px 0 0; font-size: 14px; color: oklch(0.9 0.03 290); }

/* Иконка «на ладони»: кольцо прогресса вокруг иконки - узнаваемый элемент приложения */
.mark { position: relative; justify-self: center; width: min(320px, 70vw); aspect-ratio: 1; }
.mark svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.mark .track { stroke: oklch(1 0 0 / 0.16); }
.mark .arc { stroke: oklch(0.98 0.01 290); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: fill 2.2s .4s var(--ease) forwards; }
.mark .arc.t { stroke: var(--teal); animation-delay: .7s; }
.mark .arc.o { stroke: var(--amber); animation-delay: 1s; }
@keyframes fill { to { stroke-dashoffset: var(--to); } }
.mark img { position: absolute; inset: 26%; width: 48%; height: 48%; border-radius: 22%; box-shadow: 0 24px 50px -18px oklch(0.15 0.1 285 / 0.7); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- Главная: что внутри ---------- */
.inside { width: min(1120px, 100% - 40px); margin: clamp(64px, 10vw, 120px) auto 0; }
.inside > h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 clamp(28px, 4vw, 48px); max-width: 18ch; }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li {
  display: grid; grid-template-columns: 64px minmax(0, 15ch) minmax(0, 1fr); gap: clamp(16px, 3vw, 40px);
  align-items: baseline; padding: clamp(22px, 3vw, 34px) 0; border-bottom: 1px solid var(--line);
}
.rows .n { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; color: var(--ink-soft); }
.rows h3 { margin: 0; font-size: clamp(20px, 2vw, 24px); letter-spacing: -0.01em; line-height: 1.2; }
.rows p { margin: 0; color: var(--ink-soft); max-width: 58ch; }
.rows .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; vertical-align: 2px; }

.cta-band { width: min(1120px, 100% - 40px); margin: clamp(56px, 8vw, 96px) auto 0; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
.cta-band p { margin: 0; font-size: clamp(20px, 2.2vw, 26px); font-weight: 650; letter-spacing: -0.01em; max-width: 30ch; }
.cta-band .store { background: var(--ink); color: var(--bg-top); }

/* ---------- Документы ---------- */
.doc { width: min(1120px, 100% - 40px); margin: 24px auto 0; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); }
.doc header { grid-column: 1 / -1; padding: clamp(20px, 4vw, 48px) 0 8px; }
.doc header h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 12px; }
.doc header p { margin: 0; color: var(--ink-soft); }
.toc { position: sticky; top: 20px; align-self: start; font-size: 14.5px; }
.toc p { font-weight: 700; margin: 0 0 10px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: block; padding: 6px 0; color: var(--ink-soft); text-decoration: none; transition: color .2s var(--ease); }
.toc a::before { content: counter(t) ". "; font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--ink); }
.prose { max-width: 68ch; }
.prose section { padding-top: 8px; scroll-margin-top: 16px; }
.prose h2 { font-size: 23px; letter-spacing: -0.01em; line-height: 1.25; margin: 40px 0 12px; }
.prose section:first-child h2 { margin-top: 8px; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--violet); }
.prose .who { color: var(--ink-soft); }
.prose dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 16px 0; }
.prose dt { font-weight: 650; }
.prose dd { margin: 0; color: var(--ink-soft); }

/* ---------- Поддержка ---------- */
.support { width: min(1120px, 100% - 40px); margin: 24px auto 0; }
.support header { padding: clamp(20px, 4vw, 48px) 0 28px; }
.support h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 12px; }
.contact {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px;
  padding: clamp(22px, 3vw, 32px); border-radius: var(--radius-m);
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.contact p { margin: 0; color: var(--ink-soft); max-width: 46ch; }
.contact a.mail { font-size: clamp(20px, 2.4vw, 28px); font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.contact a.mail:hover { text-decoration: underline; }
.faq { max-width: 72ch; margin-top: clamp(32px, 5vw, 56px); }
.faq h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin: 0 0 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 36px 20px 0; position: relative;
  font-weight: 650; font-size: 18px; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg);
  transition: transform .35s var(--ease);
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details > div { padding: 0 0 22px; color: var(--ink-soft); }
.faq details > div p { margin: 0 0 10px; }
.faq details[open] > div { animation: reveal .45s var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Подвал ---------- */
footer.bottom {
  width: min(1120px, 100% - 40px); margin: clamp(64px, 9vw, 112px) auto 0; padding: 28px 0 40px;
  border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between;
  font-size: 14.5px; color: var(--ink-soft);
}
footer.bottom nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
footer.bottom a { color: var(--ink-soft); text-decoration: none; }
footer.bottom a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Появление при прокрутке ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .mark { width: min(220px, 56vw); order: -1; justify-self: start; }
  .rows li { grid-template-columns: 40px 1fr; }
  .rows li p { grid-column: 2; }
  .doc { grid-template-columns: 1fr; }
  .toc { position: static; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; }
}
@media (max-width: 520px) {
  .top { flex-direction: column; align-items: flex-start; }
  .top nav { justify-content: flex-start; margin-left: -12px; }
  .prose dl { grid-template-columns: 1fr; gap: 2px; }
  .prose dd { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .mark .arc { stroke-dashoffset: var(--to); }
}
