/* Linvy — сайт в стиле «Sketch Tech» (как в приложении: docs/DESIGN.md в репозитории приложения).
   Без сборщиков: один файл стилей, переменные-токены, светлая и тёмная темы по системной настройке. */

:root {
  --paper: #F7F6F2;
  --paper-2: #F1EEE6;
  --surface: #FFFFFF;
  --ink: #1F2A44;
  --ink-2: #4F5D78;
  --muted: #6B7280;
  --blue: #5E86B8;
  --blue-2: #7C9ECB;
  --blue-light: #DCE6F2;
  --mint: #7FB8A4;
  --mint-light: #E3F1EC;
  --amber: #D9A441;
  --amber-light: #F7EBD2;
  --outline: #D5DCE6;
  --sketch: #A9BDD6;
  --grid: rgba(94, 134, 184, .07);
  --shadow: 0 1px 2px rgba(31, 42, 68, .04), 0 12px 32px rgba(31, 42, 68, .07);
  --phone: #1B2233;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 18px;
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11161F;
    --paper-2: #0E131B;
    --surface: #18202C;
    --ink: #E6EAF0;
    --ink-2: #B7C0CE;
    --muted: #9AA4B2;
    --blue: #8FB0DA;
    --blue-2: #6F93C2;
    --blue-light: #2A3B55;
    --mint-light: #1E3330;
    --amber-light: #3A3022;
    --outline: #2E3A4A;
    --sketch: #3B4D66;
    --grid: rgba(143, 176, 218, .05);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .25);
    --phone: #070A10;
    color-scheme: dark;
  }
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(40px, 6vw, 68px); }
h2 { font-size: clamp(30px, 4vw, 44px); }
h3 { font-size: 21px; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 16px; }

.kicker {
  font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px;
}
.hand { font-family: var(--hand); color: var(--blue); font-weight: 500; }
.lead { font-size: 20px; color: var(--ink-2); max-width: 36em; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--outline); }
.nav { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 1px var(--outline); }
.brand span { font-family: var(--serif); font-weight: 700; font-size: 24px; }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 15px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--blue); }
.menu-btn { display: none; background: none; border: 1px solid var(--outline); border-radius: 10px; width: 40px; height: 40px; color: var(--ink); cursor: pointer; }
.menu-btn svg { margin: auto; }

@media (max-width: 820px) {
  .menu-btn { display: block; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--outline); padding: 8px 16px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links li a { display: block; padding: 12px 4px; border-bottom: 1px dashed var(--outline); }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 28px; border-radius: 999px; font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s, box-shadow .15s;
}
.btn-primary { background: linear-gradient(90deg, var(--blue-2), var(--blue)); color: #fff; box-shadow: 0 8px 22px rgba(94, 134, 184, .32); }
.btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 26px rgba(94, 134, 184, .4); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--outline); }
.btn-secondary:hover { border-color: var(--blue); color: var(--ink); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0E1520; } .btn-primary:hover { color: #0E1520; } }
.btn svg { width: 20px; height: 20px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.note { font-size: 14px; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 56px 0 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; position: relative; z-index: 1; padding-bottom: 72px; }
.hero h1 em { font-style: normal; color: var(--blue); }
.hero .hand-quote { font-size: 32px; margin: 26px 0 0; transform: rotate(-2deg); transform-origin: left; }
.hero-art { position: relative; display: flex; justify-content: center; padding: 20px 0 70px; }
.hero-art .ring { position: absolute; width: 118%; max-width: 560px; top: 2%; left: 50%; transform: translateX(-50%); opacity: .55; }
.hero-landscape { position: absolute; left: 0; right: 0; bottom: 0; height: 180px; background: url("../img/landscape.svg") center bottom / cover no-repeat; pointer-events: none; }
.leaf { position: absolute; width: 90px; opacity: .55; pointer-events: none; }
@media (max-width: 900px) {
  .hero { padding-top: 32px; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero .btn-row { justify-content: center; }
  .hero .hand-quote { transform-origin: center; }
  .hero-art { padding-top: 0; }
}

/* ---------- Телефон ---------- */
.phone {
  position: relative; width: 290px; aspect-ratio: 9 / 19.4; border-radius: 44px; background: var(--phone); padding: 9px;
  box-shadow: 0 30px 60px rgba(31, 42, 68, .25), inset 0 0 0 2px #2C3550;
  flex: none;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 36px; background: #F6F4EF; }
.phone-sm { width: 230px; border-radius: 36px; padding: 7px; }
.phone-sm img { border-radius: 30px; }
/* Скриншот шторки: низ с системными уведомлениями эмулятора затухает (как в скриншотах для Play) */
.phone.fade::after {
  content: ""; position: absolute; left: 7px; right: 7px; bottom: 7px; height: 52%; border-radius: 0 0 30px 30px;
  background: linear-gradient(rgba(230, 229, 234, 0), #E6E5EA 30%);
}

/* ---------- Секции ---------- */
section { padding: 96px 0; position: relative; }
.section-head { max-width: 720px; margin: 0 0 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .lead { margin-left: auto; margin-right: auto; }
@media (max-width: 600px) { section { padding: 64px 0; } }

.card {
  background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.badge {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-light); color: var(--blue); margin-bottom: 18px;
}
.badge svg { width: 24px; height: 24px; }
.badge.mint { background: var(--mint-light); color: var(--mint); }
.badge.amber { background: var(--amber-light); color: var(--amber); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.features .card h3 { margin-bottom: 8px; }
.features .card p { color: var(--ink-2); margin: 0; font-size: 16px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }

/* ---------- Галерея ---------- */
.gallery {
  display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px 24px 28px;
  scrollbar-width: thin; scrollbar-color: var(--sketch) transparent;
}
.gallery figure { margin: 0; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.gallery figcaption { text-align: center; max-width: 230px; }
.gallery figcaption b { display: block; font-family: var(--serif); font-size: 19px; line-height: 1.25; }
.gallery figcaption span { font-size: 14px; color: var(--muted); }
@media (min-width: 1200px) { .gallery { justify-content: safe center; } }
.gallery-wrap { position: relative; }
.gallery-nav { display: flex; justify-content: center; gap: 10px; }
.gallery-nav button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--outline); background: var(--surface); color: var(--ink); cursor: pointer;
}
.gallery-nav button:hover { border-color: var(--blue); }

/* ---------- Честность / приватность ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checklist li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.checklist li::before {
  content: ""; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%; background: var(--mint-light)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237FB8A4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.checklist b { color: var(--ink); }
.checklist span { color: var(--ink-2); }

.quote-card { text-align: center; padding: 44px 30px; position: relative; overflow: hidden; }
.quote-card .hand { font-size: 38px; line-height: 1.1; display: block; transform: rotate(-2deg); position: relative; z-index: 1; }
.quote-card p { position: relative; z-index: 1; color: var(--ink-2); margin: 16px 0 0; }
.quote-card .mini-landscape { position: absolute; left: 0; right: 0; bottom: 0; height: 110px; background: url("../img/landscape.svg") center bottom / cover no-repeat; opacity: .9; }
.quote-card .spacer { height: 70px; }

/* ---------- Таблица разрешений ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--outline); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--outline); }
tr:last-child td { border-bottom: 0; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--blue-light) 35%, var(--surface)); }
td code { font-size: 12.5px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: color-mix(in srgb, var(--blue-light) 55%, transparent); padding: 1px 6px; border-radius: 6px; word-break: break-word; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--blue-light); color: var(--ink); white-space: nowrap; }
.tag.opt { background: var(--mint-light); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 820px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--outline); border-radius: 16px; padding: 0 22px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 30px 18px 0; font-weight: 600; position: relative; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 2px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details > div { padding: 0 0 18px; color: var(--ink-2); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- CTA ---------- */
.cta { text-align: center; padding: 96px 0 0; overflow: hidden; }
.cta .wrap { position: relative; z-index: 1; }
.cta .landscape { height: 240px; background: url("../img/landscape.svg") center bottom / cover no-repeat; margin-top: 40px; }
.app-icon-lg { width: 96px; height: 96px; border-radius: 26px; margin: 0 auto 24px; box-shadow: var(--shadow), 0 0 0 1px var(--outline); }

/* ---------- Подвал ---------- */
.site-footer { border-top: 1px solid var(--outline); background: var(--paper-2); padding: 40px 0 48px; font-size: 15px; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: flex-start; }
.footer-grid nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--ink); text-decoration: underline; }
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand img { width: 32px; height: 32px; border-radius: 9px; }
.footer-brand b { font-family: var(--serif); color: var(--ink); font-size: 20px; }
.footer-small { margin-top: 20px; font-size: 13px; }

/* ---------- Юридические страницы ---------- */
.doc-hero { padding: 56px 0 24px; }
.doc-hero h1 { font-size: clamp(36px, 5vw, 54px); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 15px; }
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; padding: 24px 0 96px; align-items: start; }
.toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; font-size: 14px; padding-right: 6px; }
.toc p { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--outline); counter-reset: toc; }
.toc a {
  display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.35;
}
.toc a:hover { color: var(--ink); }
.toc a.active { border-left-color: var(--blue); color: var(--ink); font-weight: 600; }
.doc { background: var(--surface); border: 1px solid var(--outline); border-radius: 22px; padding: 48px 56px; box-shadow: var(--shadow); min-width: 0; }
.doc h2 { font-size: 28px; margin-top: 2.2em; padding-top: .2em; }
.doc h2:first-child, .doc .summary + h2 { margin-top: 0; }
.doc h3 { font-size: 19px; margin-top: 1.6em; font-family: var(--sans); font-weight: 700; letter-spacing: 0; }
.doc p, .doc li { color: var(--ink-2); }
.doc strong { color: var(--ink); }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.doc li { margin-bottom: .45em; }
.doc .table-wrap { margin: 0 0 1.4em; box-shadow: none; }
.doc table { font-size: 14.5px; }
.doc td { color: var(--ink-2); }
.doc td strong { color: var(--ink); }
.summary { background: color-mix(in srgb, var(--blue-light) 45%, var(--surface)); border: 1px solid var(--outline); border-radius: 16px; padding: 24px 28px; margin-bottom: 40px; }
.summary h2 { margin: 0 0 12px; font-size: 22px; }
.summary ul { margin: 0; }
.callout { border-left: 3px solid var(--mint); background: color-mix(in srgb, var(--mint-light) 55%, var(--surface)); padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 0 0 1.2em; }
.callout p:last-child { margin: 0; }
.callout.warn { border-left-color: var(--amber); background: color-mix(in srgb, var(--amber-light) 60%, var(--surface)); }
.doc .caps { text-transform: uppercase; font-size: 14.5px; letter-spacing: .01em; }
.doc-foot { margin-top: 48px; padding-top: 24px; border-top: 1px dashed var(--outline); font-size: 15px; }
@media (max-width: 960px) {
  .doc-layout { grid-template-columns: 1fr; gap: 20px; }
  .toc { position: static; max-height: none; background: var(--surface); border: 1px solid var(--outline); border-radius: 16px; padding: 18px 20px; }
  .doc { padding: 28px 20px; border-radius: 18px; }
}

/* Незаполненные данные (см. TODO.md) — заметно, чтобы не пропустить перед публикацией */
.todo { background: var(--amber-light); outline: 1px dashed var(--amber); border-radius: 4px; padding: 0 4px; color: var(--ink); font-style: normal; }

/* ---------- 404 ---------- */
.not-found { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 60px 0 0; }
.not-found .big { font-family: var(--serif); font-size: 120px; line-height: 1; color: var(--blue); }

/* ---------- Появление при прокрутке ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }

@media print {
  body { background: #fff; font-size: 12pt; }
  .site-header, .site-footer, .toc, .menu-btn { display: none !important; }
  .doc-layout { display: block; padding: 0; }
  .doc { border: 0; box-shadow: none; padding: 0; }
  a { color: inherit; }
  .doc a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 10pt; }
}
