/* ============================================================
   Base layer for the СМП site. Theme colours live in smp.css.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&family=Manrope:wght@600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }
[id] { scroll-margin-top: 84px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--appbar-bg, rgba(20,36,66,.94));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border, rgba(255,255,255,.12));
  padding-top: env(safe-area-inset-top, 0px);
}
.appbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand {
  display: inline-flex; align-items: center; gap: 11px; text-decoration: none;
  font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: .01em; color: var(--ink);
}
.brand-mark { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255,255,255,.1); }
.appbar-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.appbar-links a {
  text-decoration: none; font-size: 14.5px; font-weight: 600; color: var(--ink-soft);
  padding: 8px 14px; border-radius: 100px; transition: color .2s ease, background .2s ease;
}
.appbar-links a:hover, .appbar-links a.is-current { color: var(--ink); background: rgba(255,255,255,.08); }
.appbar-cta { padding: 9px 18px !important; font-size: 14px !important; }
@media (max-width: 720px) {
  .appbar-links a:not(.appbar-cta) { display: none; }
  .appbar-links a.back-link { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 24px; border-radius: 14px; border: 1px solid transparent;
  font-size: 15.5px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .25s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--btn-grad); color: var(--btn-ink); box-shadow: 0 14px 30px -14px var(--accent-shadow); }
.btn-primary:hover { box-shadow: 0 18px 34px -12px var(--accent-shadow); }
.btn-ghost { background: var(--ghost-bg); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: rgba(79,140,255,.45); background: rgba(255,255,255,.1); }
.btn-appstore-ico { width: 20px; height: 20px; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ---------- Sections ---------- */
.band { padding: 76px 24px; }
.section-head { max-width: 720px; margin: 0 0 44px; }
.section-head h2 { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.15; margin: 0 0 14px; letter-spacing: -.01em; }
.section-head p { font-size: 16.5px; line-height: 1.65; color: var(--ink-soft); margin: 0; }
.kicker {
  display: inline-block; font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-light); margin-bottom: 14px;
}
.kicker-with-sig .kicker { margin-bottom: 0; }

/* ---------- Tags ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 100px; padding: 10px 18px; font-size: 14px; font-weight: 700;
}
.tag .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* ---------- Floating background icons ---------- */
.bg-floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; color: var(--accent); }
.bg-floaters svg { position: absolute; opacity: .09; animation: bg-float 14s ease-in-out infinite; }
@keyframes bg-float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-16px) rotate(6deg); } }

/* ---------- Feature rows ---------- */
.feature-row {
  display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; margin-bottom: 96px;
}
.feature-row:last-child { margin-bottom: 0; }
@media (min-width: 960px) {
  .feature-row { grid-template-columns: 1fr 1fr; gap: 64px; }
  .feature-row.reverse .feature-text { order: 2; }
  .feature-row.reverse .feature-media { order: 1; }
}
.kicker-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.kicker-row .label { font-size: 12.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-soft); }
.feature-text h3 { font-size: clamp(22px, 2.8vw, 29px); line-height: 1.2; margin: 0 0 16px; letter-spacing: -.005em; }
.feature-text > p { font-size: 16px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 22px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.feature-list li { position: relative; padding-left: 28px; font-size: 15px; line-height: 1.55; font-weight: 500; }
.feature-list li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: rgba(79,140,255,.2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fb4ff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.feature-media { display: flex; justify-content: center; align-items: center; gap: 22px; flex-wrap: wrap; }
.feature-media .phone { width: min(44vw, 210px); }
.feature-media.single .phone { width: min(60vw, 250px); }
@media (min-width: 960px) { .feature-media .phone { width: 210px; } }

/* ---------- Phone mockup (with empty screenshot placeholder) ---------- */
.phone {
  position: relative; width: 240px; aspect-ratio: 9 / 19.5; border-radius: 34px; padding: 9px;
  background: var(--phone-shell, #0a1226); box-shadow: var(--phone-shadow);
}
.phone .notch {
  position: absolute; top: 15px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 30%; height: 20px; border-radius: 14px; background: #05080f;
}
.phone > img, .phone .shot {
  width: 100%; height: 100%; object-fit: cover; border-radius: 26px; display: block; background: #0f1c38;
}
/* Empty placeholder shown until real screenshots are added */
.shot.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  padding: 24px 18px; border: 1.5px dashed rgba(255,255,255,.2);
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(79,140,255,.18), transparent 70%),
    linear-gradient(180deg, #16294e, #0f1c38);
  color: var(--ink-soft);
}
.shot.placeholder svg { width: 34px; height: 34px; opacity: .55; }
.shot.placeholder b { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.shot.placeholder small { font-size: 11px; font-family: var(--font-mono); opacity: .7; word-break: break-all; }

/* ---------- Carousel (shared by hero + showcase gallery) ---------- */
.hero-carousel { position: relative; max-width: 300px; margin: 0 auto; }
.carousel-track { position: relative; }
.carousel-slide { display: none; justify-content: center; }
.carousel-slide.current { display: flex; animation: slide-in .45s cubic-bezier(.22,1,.36,1); }
.carousel-slide .phone { width: min(70vw, 270px); }
@keyframes slide-in { from { opacity: 0; transform: translateX(18px) scale(.98); } to { opacity: 1; transform: none; } }
.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.carousel-dots button {
  width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.22); transition: width .25s ease, background .25s ease;
}
.carousel-dots button.is-active { width: 24px; border-radius: 6px; background: var(--accent); }

/* ---------- Footer ---------- */
.app-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 56px 0 30px; background: rgba(8,14,30,.35); }
.foot-grid { display: grid; grid-template-columns: 1fr; gap: 36px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1.2fr; gap: 48px; } }
.foot-col { display: flex; flex-direction: column; gap: 10px; }
.foot-col h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.foot-col a { text-decoration: none; font-size: 14.5px; font-weight: 500; color: var(--ink); opacity: .82; transition: opacity .2s ease, color .2s ease; width: fit-content; }
.foot-col a:hover { opacity: 1; color: var(--accent-light); }
.foot-col .item { font-size: 14px; line-height: 1.6; color: var(--ink-soft); max-width: 300px; }
.foot-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 44px; padding-top: 24px;
  border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-soft);
}

/* ---------- Legal pages ---------- */
.legal-hero { padding-top: 56px; padding-bottom: 8px; max-width: 800px; }
.legal-hero h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 4px 0 10px; letter-spacing: -.01em; }
.legal-hero .updated { color: var(--ink-soft); font-size: 14px; font-weight: 600; margin: 0; }
.legal-body { max-width: 800px; padding-top: 28px; padding-bottom: 72px; }
.legal-body h2 { font-size: 21px; margin: 40px 0 12px; }
.legal-body p, .legal-body li { font-size: 15.5px; line-height: 1.75; color: #c9d3ea; }
.legal-body p { margin: 0 0 14px; }
.legal-body ul { padding-left: 22px; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.legal-body a { color: var(--accent-light); text-underline-offset: 3px; }
.legal-body strong { color: var(--ink); }
.legal-toc {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 22px 26px; margin-bottom: 12px;
}
.legal-toc > div { font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 12px; }
.legal-toc ol { margin: 0; padding-left: 20px; columns: 1; column-gap: 32px; }
@media (min-width: 640px) { .legal-toc ol { columns: 2; } }
.legal-toc li { font-size: 14.5px; line-height: 1.5; padding: 3px 0; color: var(--ink-soft); break-inside: avoid; }
.legal-toc a { color: var(--ink); text-decoration: none; }
.legal-toc a:hover { color: var(--accent-light); }

@media (max-width: 640px) {
  .band { padding: 56px 20px; }
  .wrap { padding-left: 20px; padding-right: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-floaters svg, .carousel-slide.current { animation: none !important; }
}
