:root {
  color-scheme: light;
  --ink: #10283f;
  --muted: #52637a;
  --sea: #1263b0;
  --pale: #eaf3fc;
  --line: #e2e8f0;
  /* Surfaces (night mode swaps these; ADR 0031). */
  --bg: #fff;          /* page */
  --bg-soft: #f7f9fc;  /* cabinet / discovery page */
  --surface: #fff;     /* cards, menus, inputs */
  --surface-2: #f3f6fb;/* hover, subtle fills */
  --field-line: #8494a9;
  --shadow: 16 40 63;  /* rgb triplet for shadows */
  --error: #a52a36;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, sans-serif;
}

.i18n-pending body { visibility: hidden; }

.wrap {
  max-width: 1220px;
  padding: 0 28px;
}

.top {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: inherit;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.5px;
  text-decoration: none;
}

/* Original logo (origin-code): wordmark + lifebuoy ring that rolls in (app.js). */
.wordmark { gap: 1px; white-space: nowrap; }
.wordmark-ring {
  display: block;
  width: 1em;
  height: 1em;
  flex: none;
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}
.wordmark-ring.is-rolling { animation: boatmates-lifebuoy-roll 2.7s cubic-bezier(.45, 0, .55, 1) both; }
@keyframes boatmates-lifebuoy-roll {
  0%, 6% { transform: translate(var(--roll-start-x), var(--roll-top-y)) rotate(0deg) scale(.92); }
  73% { transform: translate(var(--roll-end-x), var(--roll-top-y)) rotate(var(--roll-angle)) scale(1); }
  82% { transform: translate(var(--drop-mid-x), var(--drop-mid-y)) rotate(var(--roll-angle-mid)) scale(1.04); }
  90% { transform: translate(var(--drop-near-x), -2px) rotate(var(--roll-angle-end)) scale(.97); }
  96% { transform: translate(0, 2px) rotate(var(--roll-angle-end)) scale(1.02); }
  100% { transform: translate(0, 0) rotate(var(--roll-angle-end)) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .wordmark-ring.is-rolling { animation: none; } }

.lang {
  display: flex;
  gap: 4px;
}

.lang__btn {
  min-width: 42px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 700 .875rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.lang__btn:hover { background: var(--pale); }

.lang__btn[aria-pressed="true"] {
  background: var(--sea);
  color: #fff;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 3px;
}

.hero {
  padding: 72px 0 52px;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--sea);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1 {
  max-width: 940px;
  margin: 14px auto 18px;
  font-size: clamp(36px, 6vw, 70px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.lead {
  max-width: 780px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 19px;
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 1060px;
  margin: 0 auto;
  padding-bottom: 72px;
}

.audience-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgb(var(--shadow) / 9%);
}

.audience-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.9;
  object-fit: cover;
  object-position: center bottom;
  background: var(--pale);
  border-bottom: 1px solid var(--line);
}

.audience-body { padding: 28px 30px 30px; }

.audience-body h2 {
  margin: 0 0 10px;
  font-size: 27px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.audience-body p {
  margin: 0;
  color: var(--muted);
}

.foot {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 54px 0 34px; }
  .lead { font-size: 17px; }
  .audience-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }
}

@media (max-width: 540px) {
  .wrap { padding: 0 14px; }
  .top { min-height: 68px; }
  .wordmark { font-size: 18px; }
  .hero { padding: 42px 0 36px; }
  .lead { font-size: 16px; }
  .audience-grid {
    gap: 16px;
    padding-bottom: 48px;
  }
  .audience-card { border-radius: 19px; }
  .audience-body { padding: 22px 20px 23px; }
  .audience-body h2 { font-size: 23px; }
}

.top-account:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-inline-start: auto;
}
.top-account a { font-weight: 700; text-decoration: none; }
@media (max-width: 650px) {
  .top { flex-wrap: wrap; }
  .top-account:not([hidden]) { order: 1; flex-basis: 100%; margin: 0 0 8px; }
}

.with-discovery { background: var(--bg-soft); }
.with-discovery .hero {
  position: relative;
  margin: 14px 0 34px;
  padding: clamp(24px, 4vw, 52px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: radial-gradient(ellipse at top right, var(--hero-glow, #dceeea), transparent 65%), var(--hero-bg, #fffefa);
  text-align: left;
}
.with-discovery .hero h1 { max-width: 780px; margin-inline: 0; text-wrap: initial; }
.with-discovery .hero .lead { margin-inline: 0; }
#landing-search .market-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 8px;
}
.landing-services, .landing-results { margin: 0 0 36px; }
.landing-services h2 { margin: 0; }
.landing-services > p { margin: 4px 0 14px; color: var(--muted); }
.landing-service-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.landing-service-card {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: end;
  overflow: hidden;
  min-height: 78px;
  aspect-ratio: 3;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-weight: 750;
  text-decoration: none;
}
.landing-service-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(transparent 20%, rgb(7 23 34 / 88%));
}
.landing-service-photo {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.landing-service-photo[class*="tile-column-"] {
  width: 300%;
  height: 600%;
  inset: calc(var(--tile-row, 0) * -100%) auto auto calc(var(--tile-column, 0) * -100%);
  object-fit: fill;
}
.tile-column-1 { --tile-column: 1; }
.tile-column-2 { --tile-column: 2; }
.tile-row-1 { --tile-row: 1; }
.tile-row-2 { --tile-row: 2; }
.tile-row-3 { --tile-row: 3; }
.tile-row-4 { --tile-row: 4; }
.tile-row-5 { --tile-row: 5; }
@media (max-width: 700px) {
  .landing-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  #landing-search .market-form, .landing-service-grid { grid-template-columns: minmax(0, 1fr); }
}

.with-discovery .hero::before {
  content: "";
  position: absolute;
  inset: 10% 7% auto auto;
  width: clamp(72px, 16vw, 176px);
  aspect-ratio: 1;
  border: 12px solid rgb(51 146 135 / 13%);
  border-inline-end-color: rgb(222 110 101 / 18%);
  border-radius: 50%;
  pointer-events: none;
}

/* Footer legal links + privacy / terms pages (one article per language, ADR 0027). */
.foot { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-links a { color: inherit; }
html[data-lang="en"] [data-legal-lang]:not([data-legal-lang="en"]),
html[data-lang="ru"] [data-legal-lang]:not([data-legal-lang="ru"]),
html[data-lang="cnr"] [data-legal-lang]:not([data-legal-lang="cnr"]) { display: none; }
.legal-shell { max-width: 780px; margin: 0 auto; padding: 28px 0 56px; }
.legal h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 12px; }
.legal h2 { font-size: 20px; margin: 28px 0 8px; }
.legal p { line-height: 1.65; overflow-wrap: anywhere; }
.legal-draft { padding: 10px 14px; border-radius: 10px; background: #fff8e1; border: 1px solid #e0a800; }
.legal-updated { color: var(--muted, #52637a); font-size: 14px; }

.cms-wordmark { display: none; width: auto; height: auto; max-width: 132px; max-height: 38px; }
.with-cms-logo .cms-wordmark { display: block; }
.with-cms-logo :is(.wordmark-name, .wordmark-ring) { display: none; }

.hero:has(.cms-hero-background) { position: relative; isolation: isolate; overflow: hidden; }
.cms-hero-background {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero:has(.cms-hero-background)::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, rgb(var(--veil, 255 255 255) / 97%), rgb(var(--veil, 255 255 255) / 75%));
  pointer-events: none;
}
.landing-banner:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  overflow: hidden;
  margin: 0 0 36px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--pale);
}
.cms-banner-image {
  flex: 1 1 280px;
  min-width: 0;
  width: min(100%, 420px);
  aspect-ratio: 2;
  object-fit: cover;
}
.cms-banner-copy { flex: 1 1 280px; min-width: 0; padding: 20px 24px; }
.cms-banner-copy h2 { margin: 0; }

/* Night mode switch in the header (ADR 0031). Icon is CSS-only; the button carries a
 * translated aria-label/title and aria-pressed (true = night mode). */
.theme-toggle {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 700 1.05rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--pale); }
.theme-toggle::before { content: "\263E"; }               /* ☾ — switch to night */
.theme-toggle[aria-pressed="true"]::before { content: "\2600"; } /* ☀ — switch to day */
.top-tools { display: flex; align-items: center; gap: 6px; }

/* Night palette. app.js sets data-scheme on <html> before first paint from the saved
 * choice (bm.theme / bm_theme) or the OS setting. */
:root[data-scheme="dark"] {
  color-scheme: dark;
  --ink: #e4ecf5;
  --muted: #9fb1c5;
  --sea: #2874cc;
  --pale: #1a2c40;
  --line: #273a4f;
  --bg: #0c1520;
  --bg-soft: #0e1824;
  --surface: #142131;
  --surface-2: #1b2b3e;
  --field-line: #50657e;
  --shadow: 0 0 0;
  --error: #ff8f9a;
  --hero-glow: #123038;
  --hero-bg: #111d2b;
  --veil: 12 21 32;
  --link: #8cc2f5;
}
:root[data-scheme="dark"] .eyebrow { color: var(--link); }
:root[data-scheme="dark"] .legal-draft { background: #2e2610; border-color: #8a6d12; }
:root[data-scheme="dark"] .legal a, :root[data-scheme="dark"] .foot-links a { color: var(--link); }
:root[data-scheme="dark"] .audience-image { filter: brightness(.9); }
