:root {
  --bg: #0b0b0c;
  --surface: #131316;
  --surface-2: #1a1a1f;
  --border: #26262c;
  --text: #f4f4f5;
  --muted: #8a8a93;
  --accent: #e8e0c9;
  --accent-ink: #0b0b0c;
  --shadow: 0 30px 60px -20px rgba(0,0,0,.5);
  --radius: 18px;
}

html[data-theme="light"] {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f0ece2;
  --border: #e4ddcc;
  --text: #14140f;
  --muted: #6a6759;
  --accent: #14140f;
  --accent-ink: #f7f5f0;
  --shadow: 0 30px 60px -20px rgba(20,20,15,.15);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 16px; height: 16px; display: inline-block; vertical-align: middle; }

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.03em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  letter-spacing: .04em;
}
.lang-toggle .sep { opacity: .35; color: var(--muted); }
.lang-toggle [data-lang] {
  color: var(--muted);
  background: none;
  border: 0;
  padding: 2px 3px;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color .15s ease;
}
.lang-toggle [data-lang]:hover { color: var(--text); }
html[lang="en"] .lang-toggle [data-lang="en"] { color: var(--text); }
html[lang="ua"] .lang-toggle [data-lang="ua"] { color: var(--text); }
html[lang="pl"] .lang-toggle [data-lang="pl"] { color: var(--text); }

.theme-toggle {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { border-color: var(--border); color: var(--text); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { width: 16px; height: 16px; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: inline-block; }

/* ---------- language visibility ---------- */
html[lang="en"] [data-i18n$=".ua"], html[lang="en"] [data-i18n$=".pl"] { display: none; }
html[lang="ua"] [data-i18n$=".en"], html[lang="ua"] [data-i18n$=".pl"] { display: none; }
html[lang="pl"] [data-i18n$=".en"], html[lang="pl"] [data-i18n$=".ua"] { display: none; }

/* ---------- layout ---------- */
.page {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- hero ---------- */
.hero {
  padding: 96px 0 56px;
  max-width: 780px;
  animation: fadeUp .6s ease both;
}
.hero h1 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1.02;
  letter-spacing: -.035em;
  margin: 0 0 18px;
}
.hero .subhead {
  font-size: 18px;
  color: var(--muted);
  margin: 0;
  max-width: 520px;
}

/* ---------- demo cards ---------- */
.demos { padding: 32px 0 64px; }

.demo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 820px) {
  .demo-grid { grid-template-columns: repeat(3, 1fr); }
}

.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color .2s ease, transform .2s ease;
  animation: fadeUp .7s ease both;
}
.demo-card:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--border)); }

.demo-head h2 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 6px;
  letter-spacing: -.02em;
}
.demo-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  align-self: flex-start;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }

.btn-tg {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  padding: 14px 22px;
  font-size: 15px;
}
.btn-tg:hover { background: color-mix(in srgb, var(--text) 85%, var(--accent)); }

/* ---------- contact ---------- */
.contact {
  display: flex;
  justify-content: center;
  padding: 32px 0 96px;
}

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.demo-card:nth-child(2) { animation-delay: .08s; }
.demo-card:nth-child(3) { animation-delay: .16s; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .topbar-inner { padding: 12px 18px; }
  .page { padding: 0 18px; }
  .hero { padding: 64px 0 36px; }
  .demo-card { padding: 22px 20px 20px; }
  .foot { flex-direction: column; gap: 8px; text-align: center; }
}
