:root {
  --bg: #f4f1ea;
  --paper: #fffdfa;
  --paper-soft: #f8f2e8;
  --ink: #151116;
  --ink-2: #2b2328;
  --muted: #716871;
  --line: rgba(31, 24, 30, 0.12);
  --rose-deep: #812f55;
  --teal: #2d7d79;
  --blue: #384f78;
  --gold: #c9a35b;
  --gold-soft: #f1dfb8;
  --plum: #25131f;
  --shadow: 0 30px 80px rgba(22, 15, 20, 0.18);
  --shadow-soft: 0 20px 54px rgba(22, 15, 20, 0.1);
  --radius: 8px;
  --scroll-progress: 0%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.9), rgba(244, 241, 234, 0.98) 38%, #eee8dd),
    linear-gradient(125deg, rgba(129, 47, 85, 0.1), transparent 25%, rgba(45, 125, 121, 0.12) 62%, transparent),
    linear-gradient(90deg, rgba(201, 163, 91, 0.1), transparent 34%, rgba(56, 79, 120, 0.07)),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(21, 17, 22, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 17, 22, 0.028) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.46), transparent 42%);
  background-size: 76px 76px, 76px 76px, 100% 100%;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 68%);
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: var(--scroll-progress);
  height: 3px;
  z-index: 100;
  background: linear-gradient(90deg, var(--gold), var(--rose-deep), var(--teal));
  box-shadow: 0 0 18px rgba(201, 163, 91, 0.34);
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid rgba(185, 77, 111, 0.28);
  outline-offset: 3px;
}

.container {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(31, 24, 30, 0.09);
  background: rgba(255, 253, 250, 0.76);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 16px 42px rgba(22, 15, 20, 0.07);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.topbar.is-scrolled {
  background: rgba(255, 253, 250, 0.94);
  box-shadow: 0 18px 42px rgba(22, 15, 20, 0.1);
}

.topbar-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand img {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  background: #fffdfa;
  box-shadow: 0 16px 32px rgba(129, 47, 85, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 19px;
  border: 1px solid rgba(31, 24, 30, 0.13);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 253, 250, 0.92);
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 10px 24px rgba(22, 15, 20, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 47, 85, 0.3);
  background: #fffdfa;
  box-shadow: 0 18px 40px rgba(22, 15, 20, 0.13);
}

.btn-primary {
  color: #fffaf4;
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(135deg, #171118, var(--plum) 48%, var(--rose-deep));
  box-shadow: 0 20px 46px rgba(129, 47, 85, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(135deg, #211720, #351a2c 48%, #963b61);
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 253, 250, 0.76);
}

.lang-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(31, 24, 30, 0.11);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 10px 24px rgba(22, 15, 20, 0.04);
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 33px;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

html[lang="uk"] .lang-switch a[data-lang-option="uk"],
html[lang="ru"] .lang-switch a[data-lang-option="ru"],
.lang-switch a.is-active {
  color: #fffdfa;
  background: linear-gradient(135deg, var(--ink), var(--plum));
}

main.container {
  padding-top: 38px;
  padding-bottom: 58px;
}

main.container > section + section {
  margin-top: 18px;
}

.hero,
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(31, 24, 30, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.98), rgba(248, 242, 232, 0.93)),
    var(--paper);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hero {
  min-height: auto;
  padding: 46px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(100deg, rgba(255, 253, 250, 0.98), rgba(248, 242, 232, 0.92) 62%, rgba(129, 47, 85, 0.08)),
    var(--paper);
}

.hero::before,
.card::before {
  content: "";
  display: block;
  width: 46px;
  height: 2px;
  margin-bottom: 20px;
  background: linear-gradient(90deg, var(--gold), rgba(189, 77, 114, 0.44), rgba(45, 125, 121, 0.28));
}

.card:hover,
.hero:hover {
  transform: translateY(-3px);
  border-color: rgba(129, 47, 85, 0.24);
  box-shadow: 0 28px 64px rgba(22, 15, 20, 0.14);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: #76531b;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 54px;
  line-height: 1.01;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 9px;
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1.25;
}

.lead {
  max-width: 780px;
  color: var(--muted);
  font-size: 22px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}

.card {
  padding: 28px;
}

.card p,
.card li,
.prose p,
footer {
  color: var(--muted);
}

.prose p {
  margin-bottom: 14px;
}

.prose p:last-child {
  margin-bottom: 0;
}

.list {
  padding-left: 20px;
  margin: 0;
}

.list li + li {
  margin-top: 8px;
}

.list li::marker {
  color: var(--gold);
}

.cta {
  color: #fffaf4;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 36%),
    linear-gradient(135deg, #171118, var(--plum) 48%, #7c2f53);
  box-shadow: var(--shadow);
}

.cta h2 {
  color: #fffaf4;
}

.cta .lead {
  margin-right: auto;
  margin-left: auto;
  color: rgba(255, 250, 244, 0.76);
}

.cta .btn-primary {
  color: var(--ink);
  background: linear-gradient(135deg, #fff9ec, #e5c777);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 28px auto 0;
  max-width: 980px;
}

.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: rgba(255, 250, 244, 0.82);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 850;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.links a:hover,
.links a.active {
  transform: translateY(-2px);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, #fff9ec, #dfc382);
}

footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 46px;
  background: rgba(255, 253, 248, 0.62);
}

.small {
  font-size: 14px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.to-top {
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  right: calc(18px + env(safe-area-inset-right, 0px)) !important;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  color: #fffaf4;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(135deg, #171118, var(--plum) 48%, var(--rose-deep));
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.92);
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  z-index: 140;
}

.to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.to-top:hover {
  box-shadow: 0 24px 52px rgba(129, 47, 85, 0.26);
}

.to-top span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.to-top svg {
  display: block;
  width: 24px;
  height: 24px;
}

@media (max-width: 900px) {
  .topbar-inner {
    min-height: 70px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 44px;
  }

  h2 {
    font-size: 30px;
  }

  .lead {
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1080px);
  }

  .topbar-inner {
    min-height: 66px;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 19px;
  }

  .brand img {
    flex: 0 0 36px;
  }

  .topbar-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    width: auto;
  }

  .topbar-actions .btn.btn-primary {
    display: none;
  }

  .lang-switch {
    margin-left: auto;
  }

  main.container {
    padding-top: 26px;
    padding-bottom: 42px;
  }

  .hero,
  .card {
    padding: 22px;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 26px;
  }

  .lead {
    font-size: 18px;
  }

  .actions .btn,
  .cta .btn {
    width: 100%;
  }

  .links {
    gap: 9px;
  }

  .links a {
    min-height: 42px;
    padding: 8px 12px;
  }

  .small {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Premium redesign pass */
body {
  background:
    linear-gradient(180deg, #110d14 0, #1d1320 360px, #f4f0e8 361px, #eee7db 100%),
    var(--bg);
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  opacity: 0.7;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 62%);
}

.topbar {
  border-bottom-color: rgba(255, 255, 255, 0.1);
  background: rgba(17, 13, 20, 0.76);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.18);
}

.topbar.is-scrolled {
  background: rgba(17, 13, 20, 0.9);
}

.brand {
  color: #fffaf4;
}

.brand img {
  background: rgba(255, 250, 244, 0.94);
}

.lang-switch {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.lang-switch a {
  color: rgba(255, 250, 244, 0.74);
}

html[lang="uk"] .lang-switch a[data-lang-option="uk"],
html[lang="ru"] .lang-switch a[data-lang-option="ru"],
.lang-switch a.is-active {
  color: #171118;
  background: linear-gradient(135deg, #fff9ea, #d9b760);
}

.btn-primary {
  min-height: 50px;
  padding: 0 23px;
  color: #171118;
  border-color: rgba(255, 255, 255, 0.24);
  background: linear-gradient(135deg, #fff9ea, #e1c16e 52%, #bd8d33);
  box-shadow: 0 22px 52px rgba(201, 163, 91, 0.24), 0 12px 28px rgba(129, 47, 85, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fffdf4, #e8cb7b 52%, #c8983c);
}

.btn-ghost {
  color: #fffaf4;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

main.container {
  padding-top: 46px;
}

.hero {
  padding: 58px;
  color: #fffaf4;
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(105deg, rgba(17, 13, 20, 0.98), rgba(37, 19, 31, 0.94) 56%, rgba(129, 47, 85, 0.84)),
    #171118;
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.28);
}

.hero::before {
  background: linear-gradient(90deg, #d9b760, rgba(189, 77, 114, 0.72), rgba(45, 125, 121, 0.5));
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 320px;
  height: 320px;
  background: url("/logo.svg") center / contain no-repeat;
  opacity: 0.08;
  filter: invert(1);
  transform: rotate(-8deg);
}

.hero h1 {
  max-width: 860px;
  color: #fffaf4;
  font-size: 62px;
  text-wrap: balance;
}

.hero .lead {
  color: rgba(255, 250, 244, 0.76);
  font-size: 23px;
}

.eyebrow {
  color: #e1c16e;
}

.card {
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.98), rgba(246, 238, 225, 0.94)),
    var(--paper);
  border-color: rgba(36, 25, 31, 0.14);
  box-shadow: 0 24px 70px rgba(22, 15, 20, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.grid .card:first-child {
  color: #fffaf4;
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(145deg, rgba(37, 19, 31, 0.97), rgba(122, 45, 79, 0.93)),
    var(--plum);
}

.grid .card:first-child h3,
.grid .card:first-child p {
  color: rgba(255, 250, 244, 0.82);
}

.cta {
  background:
    linear-gradient(90deg, rgba(17, 13, 20, 0.96), rgba(37, 19, 31, 0.94) 48%, rgba(129, 47, 85, 0.86));
}

.cta .btn-primary,
.links a:hover,
.links a.active {
  color: #171118;
  background: linear-gradient(135deg, #fff9ea, #e1c16e 52%, #bd8d33);
}

footer {
  background: #171118;
}

footer,
footer a {
  color: rgba(255, 250, 244, 0.76);
}

.to-top {
  color: #171118;
  background: linear-gradient(135deg, #fff9ea, #e1c16e 52%, #bd8d33);
}

@media (max-width: 900px) {
  .hero h1 {
    font-size: 48px;
  }
}

@media (max-width: 640px) {
  body {
    background:
      linear-gradient(180deg, #110d14 0, #1d1320 520px, #f4f0e8 521px, #eee7db 100%),
      var(--bg);
  }

  .topbar {
    background: rgba(17, 13, 20, 0.88);
  }

  .hero {
    padding: 34px 24px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero .lead {
    font-size: 20px;
  }
}
