/* Vili Chat public pages. One stylesheet, no web fonts, no scripts. Brand:
   lime mark (#C6F01F) on dark glass (docs/design/brand, apple/docs/DESIGN-SYSTEM.md
   section 13). Lime is never used for text; links use a light blue. */

:root {
  color-scheme: dark;
  --bg-top: #1a1b20;
  --bg-bottom: #0c0d10;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(24, 25, 30, 0.72);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #f2f3f5;
  --muted: #a9aeb8;
  --link: #8ec5ff;
  --lime: #c6f01f;
  --lime-ink: #1a1e0b;
  --radius: 20px;
  --gutter: 16px;
  --measure: 46rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg-bottom); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background-color: var(--bg-bottom);
  background-image:
    radial-gradient(60rem 30rem at 50% -8rem, rgba(198, 240, 31, 0.10), transparent 70%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom) 40rem);
  background-repeat: no-repeat;
  overflow-wrap: break-word;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .button:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  z-index: 10;
}
.skip:focus { top: 0.75rem; }

/* Header and footer: frosted bars */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
}

.bar {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.6rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-family: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.brand img { width: 2rem; height: 2rem; display: block; }

.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; padding: 0; list-style: none; }
.nav li + li { margin-top: 0; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 2px; text-underline-offset: 0.35em; }

main { display: block; }
[id] { scroll-margin-top: 5rem; }

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
}

.site-footer {
  border-top: 1px solid var(--glass-border);
  background: rgba(12, 13, 16, 0.6);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .bar { padding-top: 1.25rem; padding-bottom: 1.5rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* Text */

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 0 0 0.5rem; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; padding-top: 0.25rem; }
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; }
li + li { margin-top: 0.35rem; }
strong { font-weight: 600; }
.lede { font-size: 1.15rem; color: var(--muted); }
.meta { color: var(--muted); font-size: 0.95rem; }
.small { font-size: 0.9rem; color: var(--muted); }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }

/* Glass panels */

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0.5rem;
  margin: 0 0 1.25rem;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.toc { padding: 1rem 1.25rem; }
.toc ol { margin: 0; columns: 2 14rem; column-gap: 2rem; }
.toc li { break-inside: avoid; }

/* Tables scroll inside their own box on narrow screens */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: var(--glass);
}
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--glass-border); }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; color: var(--text); background: rgba(255, 255, 255, 0.04); }
td { color: #dcdfe4; }

/* FAQ */

.faq { padding-top: 1rem; }
.faq h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }

/* Home page */

.hero {
  max-width: 64rem;
  margin: 0 auto;
  padding: 3.5rem var(--gutter) 2rem;
  text-align: center;
}
.hero img { width: 7.5rem; height: 7.5rem; display: block; margin: 0 auto 1.25rem;
  filter: drop-shadow(0 18px 40px rgba(198, 240, 31, 0.18)); }
.hero h1 { font-family: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600; font-size: clamp(2.4rem, 8vw, 3.6rem); margin-bottom: 0.25rem; }
.hero .lede { max-width: 36rem; margin: 0 auto 1.75rem; }

.downloads { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin: 0 0 0.75rem; padding: 0; list-style: none; }
.downloads li + li { margin-top: 0; }

.button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 12rem;
  padding: 0.7rem 1.2rem;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  color: var(--lime-ink);
  background: var(--lime);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.button span { font-weight: 400; font-size: 0.85rem; }
.button.pending {
  color: var(--text);
  background: var(--glass);
  border-color: var(--glass-border);
}
.button.pending span { color: var(--muted); }

.features {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem var(--gutter) 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}
.features .card { margin: 0; }
.features h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }
.features p { color: #dcdfe4; }

.notice {
  border-left: 3px solid var(--lime);
  padding: 0.75rem 1rem;
  background: var(--glass);
  border-radius: 0 12px 12px 0;
  margin: 0 0 1.25rem;
}

/* Narrow screens: each table row becomes a small card with labelled cells */
@media (max-width: 40rem) {
  .site-header { position: static; }
  [id] { scroll-margin-top: 1rem; }
  .table-wrap table { min-width: 0; }
  .table-wrap thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .table-wrap tr { display: block; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--glass-border); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { display: block; padding: 0; border: 0; }
  .table-wrap td:first-child { color: var(--text); font-weight: 600; margin-bottom: 0.3rem; }
  .table-wrap td + td { margin-top: 0.2rem; }
  .table-wrap td:nth-child(2)::before { content: "Where: "; color: var(--muted); }
  .table-wrap td:nth-child(3)::before { content: "Kept until: "; color: var(--muted); }
  .table-wrap:lang(ru) td:nth-child(2)::before { content: "Где: "; }
  .table-wrap:lang(ru) td:nth-child(3)::before { content: "Хранятся до: "; }
}

@media (max-width: 30rem) {
  .bar { justify-content: flex-start; }
  .button { width: 100%; }
  .downloads li { width: 100%; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  .site-header { position: static; background: none; backdrop-filter: none; }
  .nav, .skip, .site-footer nav { display: none; }
  a { color: #000; }
  .card, .table-wrap, .notice { background: none; border-color: #999; backdrop-filter: none; }
  td, th, .meta, .small, .lede { color: #000; }
}
