/* Static site для Георгий Карлов — Cassiopeia-inspired blue palette */
:root {
  --color-bg: #f0f4fb;
  --color-surface: #ffffff;
  --color-text: #495057;
  --color-text-strong: #1a2438;
  --color-muted: #6c757d;
  --color-link: #2a69b8;
  --color-link-hover: #1d4d8c;
  --color-navy: #001B4C;
  --color-navy-2: #0c2e94;
  --color-active: #d51b1b;
  --color-border: #d8dee9;
  --max-width: 1400px;
  --radius: 4px;
  --shadow: 0 2px 12px rgba(0, 27, 76, 0.08);
  --font-sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Georgia", "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

a { color: var(--color-link); }
a:hover { color: var(--color-link-hover); }

img { max-width: 100%; height: auto; }

.skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  background: #fff;
  padding: 8px 12px;
  z-index: 10;
}

/* Header */
.site-header { background: var(--color-navy); }
.header-banner {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 22px 20px;
}
.header-banner .brand { display: block; line-height: 0; }
.header-banner img {
  display: block;
  max-width: 100%;
  height: auto;
  width: 832px;
}

/* Nav bar — white strip below the dark header */
.primary-nav {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 6px rgba(0, 27, 76, 0.04);
  position: sticky;
  top: 0;
  z-index: 5;
}
.primary-nav .container {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.primary-nav a {
  display: block;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--color-text-strong);
  font-weight: 500;
  font-size: 0.97rem;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.primary-nav a:hover { color: var(--color-link); }
.primary-nav li.active a {
  color: var(--color-text-strong);
  border-bottom-color: var(--color-active);
}

.nav-socials {
  display: flex;
  gap: 0;
  align-items: center;
}
.nav-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  transition: opacity 0.15s;
}
.nav-socials a:hover { opacity: 0.7; }
.nav-socials img {
  width: 25px;
  height: 25px;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text-strong);
  margin: 4px 0;
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .primary-nav .container {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 20px;
    justify-content: flex-start;
  }
  .primary-nav .container > .nav-toggle { align-self: flex-end; margin: 4px 0; }
  .nav-socials {
    display: none;
    margin-top: 12px;
    justify-content: flex-start;
  }
  .primary-nav ul.open ~ .nav-socials { display: flex; }
  .primary-nav ul {
    display: none;
    flex-direction: column;
    gap: 0;
  }
  .primary-nav ul.open { display: flex; }
  .primary-nav a {
    padding: 12px 4px;
    border-bottom: 1px solid var(--color-border);
  }
  .primary-nav li.active a {
    border-left: 3px solid var(--color-active);
    padding-left: 12px;
    border-bottom-color: var(--color-border);
  }
}

/* Logo visibility in BVI high-contrast modes - keep header dark for light backgrounds */
html[data-bvi-theme="white"] body .site-header,
body[data-bvi-theme="white"] .site-header,
body .bvi-body[data-bvi-theme="white"] .site-header,
html[data-bvi-theme="brown"] body .site-header,
body[data-bvi-theme="brown"] .site-header,
body .bvi-body[data-bvi-theme="brown"] .site-header,
html[data-bvi-theme="green"] body .site-header,
body[data-bvi-theme="green"] .site-header,
body .bvi-body[data-bvi-theme="green"] .site-header,
html[data-bvi-theme="blue"] body .site-header,
body[data-bvi-theme="blue"] .site-header,
body .bvi-body[data-bvi-theme="blue"] .site-header {
  background: var(--color-navy) !important;
  background-color: var(--color-navy) !important;
  color: #fff !important;
  fill: #fff !important;
}

html[data-bvi-theme="white"] body .header-banner,
body[data-bvi-theme="white"] .header-banner,
body .bvi-body[data-bvi-theme="white"] .header-banner,
html[data-bvi-theme="brown"] body .header-banner,
body[data-bvi-theme="brown"] .header-banner,
body .bvi-body[data-bvi-theme="brown"] .header-banner,
html[data-bvi-theme="green"] body .header-banner,
body[data-bvi-theme="green"] .header-banner,
body .bvi-body[data-bvi-theme="green"] .header-banner,
html[data-bvi-theme="blue"] body .header-banner,
body[data-bvi-theme="blue"] .header-banner,
body .bvi-body[data-bvi-theme="blue"] .header-banner {
  background: var(--color-navy) !important;
  background-color: var(--color-navy) !important;
  color: #fff !important;
  fill: #fff !important;
}

html[data-bvi-theme="white"] body .brand img,
body[data-bvi-theme="white"] .brand img,
body .bvi-body[data-bvi-theme="white"] .brand img,
html[data-bvi-theme="brown"] body .brand img,
body[data-bvi-theme="brown"] .brand img,
body .bvi-body[data-bvi-theme="brown"] .brand img,
html[data-bvi-theme="green"] body .brand img,
body[data-bvi-theme="green"] .brand img,
body .bvi-body[data-bvi-theme="green"] .brand img,
html[data-bvi-theme="blue"] body .brand img,
body[data-bvi-theme="blue"] .brand img,
body .bvi-body[data-bvi-theme="blue"] .brand img {
  background: var(--color-navy) !important;
  background-color: var(--color-navy) !important;
}

/* Main content */
main {
  padding: 28px 20px 64px;
  position: relative;
}
.content-socials {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 16px;
}
.content-socials a { display: inline-flex; }
.content-socials img {
  display: block;
  width: 25px;
  height: 25px;
}

.article {
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}
.article-title {
  margin: 40px 0 24px;
  color: var(--color-text-strong);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  line-height: 1.2;
}
.article-body {
  color: var(--color-text);
  display: flow-root;
}
.article-body p { margin: 0 0 1em; }
.article-body a { color: var(--color-link); }
.article-body img { border-radius: 2px; }
@media (max-width: 700px) {
  .article-body img[style*="float"] {
    float: none !important;
    display: block;
    margin: 0 auto 1em !important;
  }
}

.contact-block {
  margin-top: 36px;
  padding: 24px clamp(20px, 4vw, 36px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.contact-block h2 {
  margin-top: 0;
  color: var(--color-text-strong);
  font-size: 1.4rem;
}

/* Honeypot — hidden from humans, visible to bots */
.contact-form .hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form { margin-top: 16px; }
.contact-form .form-row { margin-bottom: 14px; }
.contact-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.contact-form .req { color: var(--color-active); }
.contact-form input[type=text],
.contact-form input[type=email],
.contact-form input[type=tel],
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--color-text-strong);
  background: #fff;
  border: 1px solid #000;
  border-radius: 3px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #98a0b0;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-navy-2);
  box-shadow: 0 0 0 3px rgba(12, 46, 148, 0.15);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form .two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .contact-form .two-cols { grid-template-columns: 1fr; }
}
.contact-form input[type=file] {
  width: 100%;
  padding: 8px;
  font: inherit;
  background: #fff;
  border: 1px dashed var(--color-border);
  border-radius: 3px;
}
.contact-form input[type=file]::-webkit-file-upload-button,
.contact-form input[type=file]::file-selector-button {
  background: var(--color-navy-2);
  color: #fff;
  border: 0;
  padding: 6px 14px;
  border-radius: 3px;
  margin-right: 12px;
  cursor: pointer;
  font: inherit;
}
.contact-form .file-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--color-muted);
}
.contact-form .file-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 0.9rem;
}
.contact-form .file-list li {
  padding: 4px 0;
  color: var(--color-muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.contact-form .file-list li.error { color: var(--color-active); }

.contact-form .consent label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--color-muted);
}
.contact-form .consent input { margin-top: 4px; }
.btn-submit {
  background: var(--color-navy-2);
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 11px 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.btn-submit:hover:not([disabled]) { background: var(--color-navy); }
.btn-submit:active:not([disabled]) { transform: translateY(1px); }
.btn-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
.form-status { margin: 14px 0 0; min-height: 1.4em; font-size: 0.95rem; }
.form-status.ok    { color: #0f7d3a; }
.form-status.error { color: var(--color-active); }
.form-fallback { margin-top: 12px; color: var(--color-muted); }

/* Footer — minimal, matches the live site */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 20px 0;
  margin-top: 48px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted);
  background: var(--color-surface);
}
.site-footer p { margin: 4px 0; }
