/* Главная студии «Просто». Та же система, что у сайтов приложений (шрифты Unbounded/Golos, сетка, карточки),
   но нейтральные цвета: тёплая бумага, графит и один спокойный акцент. Цвета приложений — только в их карточках. */

@font-face { font-family: "Unbounded"; font-weight: 300 900; font-display: block; src: url("fonts/unbounded-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 300 900; font-display: block; src: url("fonts/unbounded-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Golos"; font-weight: 400 900; font-display: block; src: url("fonts/golos-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos"; font-weight: 400 900; font-display: block; src: url("fonts/golos-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215; }

:root {
  color-scheme: light dark;
  --bg: #f4f1ea;          /* тёплая бумага */
  --surface: #ffffff;
  --ink: #18181d;
  --muted: #5b5a63;
  --line: #ddd8cc;
  --accent: #4c45d6;      /* спокойный сине-фиолетовый — ссылки и действие */
  --accent-fill: #4c45d6; /* фон под белым текстом, в обеих темах */
  --accent-soft: #e7e5fb;
  --sun: #f2c14e;
  --leaf: #8fbf9f;
  --clay: #e58e6d;
  --display: "Unbounded", "Golos", system-ui, sans-serif;
  --text: "Golos", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121215; --surface: #1c1c21; --ink: #ecebf0; --muted: #a4a3ae; --line: #2e2d35; --accent: #aaa5ff; --accent-soft: #29274d;
    --sun: #d9a93a; --leaf: #5f9471; --clay: #c46e4f; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
p { margin: 0 0 14px; }

/* Шапка */
.top-row { display: flex; align-items: center; gap: 28px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; font: 700 20px/1 var(--display); text-decoration: none; letter-spacing: -0.02em; }
.mark { position: relative; width: 30px; height: 30px; border-radius: 10px; background: var(--ink); flex: none; }
.mark::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--sun); }
.brand small { font: 500 13px/1 var(--text); color: var(--muted); letter-spacing: 0; }
.nav { display: flex; gap: 24px; margin-left: auto; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); white-space: nowrap; }
.nav a:hover { color: var(--ink); }
/* Общий личный кабинет — кнопкой справа, как на страницах приложений */
.nav-login { flex: none; padding: 8px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; text-decoration: none; white-space: nowrap; }
.nav-login:hover { box-shadow: inset 0 0 0 1px var(--ink); }

/* Первый экран */
.hero { padding: 40px 0 24px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; }
h1 { font: 700 clamp(30px, 5vw, 58px)/1.06 var(--display); letter-spacing: -0.03em; margin: 0 0 26px; max-width: 11em; text-wrap: balance; }
.lead { font-size: clamp(17px, 1.7vw, 21px); line-height: 1.55; color: var(--muted); max-width: 32rem; margin: 0 0 32px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 26px; border-radius: 999px; font: 600 16px/1 var(--text);
  text-decoration: none; text-align: center; }
.btn-main { background: var(--accent-fill); color: #fff; }
.btn-main:hover { background: #3a33b8; }
.btn-quiet { box-shadow: inset 0 0 0 1px var(--line); }
.btn-quiet:hover { box-shadow: inset 0 0 0 1px var(--ink); }

/* Композиция из простых фигур и значков приложений */
.shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: min(420px, 100%); justify-self: end; }
.shape { aspect-ratio: 1; border-radius: 28px; display: grid; place-items: center; }
.shape img { width: 72%; height: auto; border-radius: 22%; box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .55); }
.s-ink { background: var(--ink); }
.s-ink::before { content: ""; width: 42%; aspect-ratio: 1; border-radius: 50%; background: var(--sun); }
.s-sun { background: var(--sun); border-radius: 50%; }
.s-leaf { background: var(--leaf); border-radius: 28px 28px 28px 50%; }
.s-clay { background: var(--clay); border-radius: 50% 50% 28px 28px; }
.s-soft { background: var(--accent-soft); }
.s-line { box-shadow: inset 0 0 0 2px var(--line); }
.s-line::before { content: ""; width: 46%; height: 6px; border-radius: 3px; background: var(--accent); }

/* Разделы */
.section { padding: 88px 0 0; }
.section-title { font: 600 clamp(26px, 3.3vw, 40px)/1.12 var(--display); letter-spacing: -0.02em; margin: 0 0 12px; text-wrap: balance; }
.section-lead { color: var(--muted); max-width: 36rem; margin: 0 0 36px; }

/* Карточки приложений. Новое приложение — ещё один <article class="app"> с двумя цветами: --app-a (фон) и --app-b (акцент) */
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.app { display: flex; flex-direction: column; background: var(--surface); border-radius: 28px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.app-head { display: flex; align-items: center; gap: 16px; padding: 24px 26px; color: #fff;
  background: linear-gradient(135deg, var(--app-a) 0%, color-mix(in srgb, var(--app-a) 70%, var(--app-b)) 140%); }
.app-head img { width: 64px; height: 64px; border-radius: 18px; flex: none; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6); }
.app-head h3 { font: 600 22px/1.2 var(--display); letter-spacing: -0.015em; margin: 0 0 4px; }
.app-head p { margin: 0; font-size: 15px; opacity: .85; }
.app-body { display: flex; flex-direction: column; flex: 1; padding: 22px 26px 26px; }
.app-body > p { color: var(--muted); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 2px 0 22px; }
.chips li { padding: 4px 12px; border-radius: 999px; font-size: 14px; background: var(--bg); }
.app-link { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 20px; border-radius: 999px;
  font-weight: 600; font-size: 15px; text-decoration: none; color: #fff; background: var(--app-a); }
.app-link::after { content: ""; width: 8px; height: 8px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); }
.app-link:hover { background: color-mix(in srgb, var(--app-a) 80%, #000); }
.app.myfinance { --app-a: #1f3f4a; --app-b: #d81b60; }
.app.splitbill { --app-a: #1f4e79; --app-b: #d13c0c; }

/* Как делаем */
.ways { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ways li { padding: 26px 24px; border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.ways .i { display: block; width: 52px; height: 52px; padding: 12px; margin-bottom: 18px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.i { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ways h3 { font: 600 19px/1.3 var(--display); letter-spacing: -0.01em; margin: 0 0 10px; }
.ways p { color: var(--muted); margin: 0; }

/* Контакты */
.contact { padding: 88px 0 88px; }
.contact-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; padding: 36px; border-radius: 28px;
  background: var(--ink); color: var(--bg); }
.contact-band .section-title { margin-bottom: 8px; }
.contact-band p { margin: 0; color: color-mix(in srgb, var(--bg) 75%, var(--ink)); max-width: 30rem; }
.mail { font: 600 clamp(18px, 2.2vw, 24px)/1.2 var(--display); letter-spacing: -0.01em; color: var(--bg); text-decoration: none; padding: 14px 24px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bg) 35%, var(--ink)); overflow-wrap: anywhere; }
.mail:hover { box-shadow: inset 0 0 0 1px var(--bg); }

/* Подвал */
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.foot a { color: var(--muted); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .shapes { justify-self: start; width: min(360px, 100%); }
  .ways { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav { gap: 16px; font-size: 14px; }
  .top-row { gap: 16px; }
  .nav-login { padding: 7px 12px; font-size: 14px; }
  .nav a:first-child { display: none; }
  .brand small { display: none; }
  .hero { padding-top: 24px; }
  .shapes { gap: 10px; }
  .shape { border-radius: 22px; }
  .s-sun { border-radius: 50%; }
  .app-head, .app-body { padding-inline: 20px; }
  .contact-band { padding: 26px 22px; }
  .cta-row .btn { flex: 1 1 auto; }
}
@media (max-width: 420px) { .nav a:nth-child(2) { display: none; } }


/* --- Движение. Только CSS: скрипты запрещены политикой безопасности. Всё — через transform и opacity, поэтому
   ничего не сдвигает соседей. При «Уменьшить движение» остаются только смены цвета. --- */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Отклик на наведение и нажатие */
.btn, .app-link, .mail, .app, .ways li, .nav-login { transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s ease, background-color .2s ease, color .2s ease; }
.btn:active, .app-link:active, .mail:active, .nav-login:active { transform: translateY(1px) scale(.98); transition-duration: .08s; }
.app-link::after { transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
.app-head img { transition: transform .35s cubic-bezier(.2, .7, .2, 1.3); }
.mark::after { transition: transform .45s cubic-bezier(.3, .7, .2, 1.2), background-color .3s ease; }

/* Пункты меню: подчёркивание вырастает слева направо */
.nav a { background: linear-gradient(currentColor, currentColor) left bottom / 0 1.5px no-repeat; padding-bottom: 2px; transition: background-size .3s ease, color .2s ease; }
.nav a:hover, .nav a:focus-visible { background-size: 100% 1.5px; }

@media (hover: hover) {
  .btn-main:hover { transform: translateY(-2px); box-shadow: 0 12px 22px -14px var(--accent-fill); }
  .btn-quiet:hover { transform: translateY(-2px); }
  .app:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--line), 0 24px 40px -28px rgba(0, 0, 0, .45); }
  .app:hover .app-head img { transform: rotate(-6deg) scale(1.06); }
  .app-link:hover::after { transform: translateX(4px) rotate(45deg); }
  .ways li:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .brand:hover .mark::after { transform: translate(-10px, -10px); background-color: var(--leaf); }
  .mail:hover { background-color: var(--bg); color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .app-link, .mail, .app, .ways li, .app-head img, .mark::after, .app-link::after { transition-property: background-color, color, box-shadow; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Первый экран: текст поднимается по очереди, следом раскладываются фигуры */
  .hero-text > * { animation: rise-in .8s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-text > :nth-child(2) { animation-delay: .1s; }
  .hero-text > :nth-child(3) { animation-delay: .2s; }
  @keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

  .shape { --d: 0s; animation: pop .6s cubic-bezier(.2, .8, .2, 1.2) var(--d) both; }
  .shape:nth-child(2) { --d: .08s; } .shape:nth-child(3) { --d: .16s; } .shape:nth-child(4) { --d: .24s; }
  .shape:nth-child(5) { --d: .32s; } .shape:nth-child(6) { --d: .40s; }
  @keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

  /* …и потом живут своей медленной жизнью: у каждой фигуры свой ритм, чтобы движение не совпадало */
  .s-ink::before { animation: orbit 11s ease-in-out 1.2s infinite; }
  @keyframes orbit {
    0%, 100% { transform: none; } 25% { transform: translate(30%, -30%); } 50% { transform: translate(0, -60%); } 75% { transform: translate(-30%, -30%); }
  }
  .s-sun { animation: pop .6s cubic-bezier(.2, .8, .2, 1.2) var(--d) both, breathe 6s ease-in-out 1.4s infinite; }
  @keyframes breathe { 50% { transform: scale(.9); } }
  .s-leaf { animation: pop .6s cubic-bezier(.2, .8, .2, 1.2) var(--d) both, leaf 12s ease-in-out 1.6s infinite; }
  @keyframes leaf {
    0%, 100% { border-radius: 28px 28px 28px 50%; } 33% { border-radius: 50% 28px 28px 28px; }
    66% { border-radius: 28px 50% 28px 28px; }
  }
  .s-line::before { transform-origin: left center; animation: fill 5s cubic-bezier(.5, 0, .3, 1) 1.8s infinite; }
  @keyframes fill { 0%, 100% { transform: scaleX(1); } 40% { transform: scaleX(.35); } 70% { transform: scaleX(1.25); } }
  .s-soft img { animation: bob 8s ease-in-out 1.2s infinite; }
  .s-soft:last-child img { animation-delay: 3.2s; animation-duration: 9s; }
  @keyframes bob { 50% { transform: translateY(-6%) rotate(-4deg); } }

  /* Медленный свет за фигурами */
  .hero { position: relative; isolation: isolate; overflow: clip; }
  .hero::before { content: ""; position: absolute; z-index: -1; width: 520px; aspect-ratio: 1; right: -120px; top: -140px; border-radius: 50%;
    background: radial-gradient(closest-side, var(--accent-soft), transparent); animation: drift 22s ease-in-out infinite alternate; }
  @keyframes drift { to { transform: translate(-160px, 120px) scale(1.15); } }

  /* При прокрутке: карточки поднимаются, значки правил прорисовываются линией */
  @supports (animation-timeline: view()) {
    .app, .ways li, .contact-band { animation: rise linear both; animation-timeline: view(); animation-range: entry 5% cover 28%; }
    .ways li:nth-child(2) { animation-range: entry 10% cover 32%; }
    .ways li:nth-child(3) { animation-range: entry 15% cover 36%; }
    /* translate, а не transform: так подъём при наведении продолжает работать */
    @keyframes rise { from { opacity: 0; translate: 0 42px; } to { opacity: 1; translate: none; } }
    .ways .i > * { stroke-dasharray: 1; animation: draw linear both; animation-timeline: view(); animation-range: entry 20% cover 40%; }
    @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  }
}
