/* Kazakhmys Holding — стили. Цвета и шрифты меняются в блоке :root. */

@font-face {
  font-family: "Bitter";
  src: url("fonts/bitter-var.woff") format("woff");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fira Sans";
  src: url("fonts/firasans-400.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fira Sans";
  src: url("fonts/firasans-500.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #1f262b;          /* антрацит: текст и заголовки */
  --slate: #5b656d;        /* второстепенный текст */
  --rule: #dde1e3;         /* тонкие линии */
  --field: #c6ccd0;        /* рамки полей ввода */
  --mist: #f3f5f6;         /* подвал */
  --accent: #2c3494;       /* синий из логотипа: ссылки и «текущее» состояние */
  --accent-deep: #1f2670;  /* наведение на кнопку */

  --font-display: "Bitter", Georgia, "Times New Roman", serif;
  --font-text: "Fira Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --wrap: 76rem;
  --gutter: clamp(1.25rem, 0.75rem + 2.2vw, 2.75rem);
  --header-h: 4.5rem;
  --section-pad: clamp(3.5rem, 2.25rem + 4.5vw, 6.5rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
p { margin: 0; }
a { color: var(--accent); }
button { font: inherit; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 60;
  background: var(--paper);
  color: var(--ink);
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--ink);
}
.skip:focus { left: 1rem; }

.text-link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
.text-link:hover { text-decoration-thickness: 2px; }

/* ---------- Плашка черновика ---------- */
.draft {
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.45;
}
.draft .wrap { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.draft[hidden] { display: none; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--rule);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  height: var(--header-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-right: auto;
  color: var(--accent);
  text-decoration: none;
}
.brand-logo { display: block; height: 3.25rem; width: auto; }
.brand-sub {
  display: flex;
  align-items: center;
  height: 1.75rem;
  padding-left: 0.875rem;
  border-left: 1px solid var(--rule);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav { display: flex; gap: 1.875rem; height: 100%; }
.nav a {
  display: flex;
  align-items: center;
  height: 100%;
  padding-top: 3px;
  border-bottom: 3px solid transparent;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { border-bottom-color: var(--rule); }
.nav a.is-current { border-bottom-color: var(--accent); }

.lang { display: flex; gap: 0.25rem; }
.lang button {
  background: none;
  border: 0;
  padding: 0.375rem 0.375rem 0.3125rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate);
  cursor: pointer;
  letter-spacing: 0.02em;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.menu-btn {
  display: none;
  height: 2.5rem;
  padding: 0 0.875rem;
  background: var(--paper);
  border: 1px solid var(--field);
  border-radius: 3px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

/* ---------- Первый экран ---------- */
.hero {
  padding-top: clamp(2.75rem, 1.5rem + 5vw, 6rem);
  padding-bottom: var(--section-pad);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 1rem + 5vw, 6rem);
  align-items: start;
}
.hero h1 {
  font-weight: 400;
  font-size: clamp(2.125rem, 1.25rem + 3vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: pretty;
}
.hero-lead {
  margin-top: 1.75rem;
  max-width: 34em;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.55;
  color: var(--slate);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.25rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.375rem;
  border-radius: 3px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }

.latest {
  border-top: 3px solid var(--accent);
  padding-top: 1.25rem;
}
.latest h2 {
  font-size: 1.25rem;
  line-height: 1.3;
}
.latest-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.latest-item {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.latest-date {
  font-size: 0.875rem;
  color: var(--slate);
  font-variant-numeric: tabular-nums lining-nums;
}
.latest-title {
  color: var(--ink);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}
a.latest-title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }
.latest-cat { font-size: 0.875rem; color: var(--slate); }
.latest-empty { padding: 1rem 0; color: var(--slate); border-bottom: 1px solid var(--rule); }
.latest-all { display: inline-block; margin-top: 1.25rem; }

/* ---------- Разделы ---------- */
.section {
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
  border-top: 1px solid var(--rule);
}
.section-head {
  max-width: 46rem;
  margin-bottom: clamp(1.75rem, 1.25rem + 2vw, 3rem);
}
.section h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.7vw, 2.625rem);
  line-height: 1.12;
}
.section-head p {
  margin-top: 1rem;
  font-size: 1.125rem;
  color: var(--slate);
  max-width: 38em;
}

/* ---------- Фильтры ---------- */
.filters { display: grid; gap: 1.5rem; margin-bottom: 1.75rem; }
.cats {
  display: flex;
  gap: 2rem;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 0.75rem 0 0.625rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--slate);
  white-space: nowrap;
  cursor: pointer;
}
.cat:hover { color: var(--ink); }
.cat[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.cat .n {
  margin-left: 0.4em;
  font-weight: 400;
  color: var(--slate);
  font-variant-numeric: tabular-nums lining-nums;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
}
.field { display: grid; gap: 0.375rem; }
.field label { font-size: 0.8125rem; color: var(--slate); }
.field select,
.field input {
  height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--field);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1 var(--font-text);
}
.field select { min-width: 9.5rem; padding-right: 2rem; }
.field input:hover, .field select:hover { border-color: var(--slate); }
.field-search { flex: 1 1 16rem; max-width: 26rem; }
.field-search input { width: 100%; }
.count {
  margin-left: auto;
  padding-bottom: 0.6rem;
  font-size: 0.9375rem;
  color: var(--slate);
  font-variant-numeric: tabular-nums lining-nums;
}

/* ---------- Реестр документов ---------- */
.docs {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}
.docs[hidden] { display: none; }
.doc {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) 11rem;
  gap: 0.25rem 2rem;
  align-items: baseline;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.doc-date {
  font-size: 0.9375rem;
  color: var(--slate);
  font-variant-numeric: tabular-nums lining-nums;
}
.doc-title {
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: none;
  max-width: 46em;
}
a.doc-title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }
.doc-cat { display: block; margin-top: 0.3rem; font-size: 0.875rem; color: var(--slate); }
.doc-file {
  justify-self: end;
  text-align: right;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums lining-nums;
}
.doc-file a { font-weight: 500; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
.doc-nofile { color: var(--slate); }

.badge {
  display: inline-block;
  padding: 0.0625rem 0.4375rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  vertical-align: 0.05em;
}
.latest-cat .badge { margin-left: 0.4rem; }

.empty {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  padding: 2.25rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  color: var(--slate);
}
.empty[hidden] { display: none; }

/* ---------- Активы ---------- */
.assets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 1rem + 5vw, 6rem);
}
.segment h3 { font-size: 1.5rem; line-height: 1.2; }
.segment > p { margin-top: 0.75rem; color: var(--slate); max-width: 30em; }
.companies {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}
.company { padding: 1.375rem 0 1.5rem; border-bottom: 1px solid var(--rule); }
.company-name { font-size: 1.3125rem; line-height: 1.25; }
.company-legal { margin-top: 0.25rem; font-size: 0.875rem; color: var(--slate); }
.company-text { margin-top: 0.625rem; max-width: 34em; }
.company-region { margin-top: 0.375rem; font-size: 0.875rem; color: var(--slate); }

/* ---------- О компании ---------- */
.company-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 1rem + 5vw, 6rem);
  align-items: start;
}
#about { margin-top: 1.5rem; }
#about p { font-size: 1.125rem; max-width: 32em; }
#about p + p { margin-top: 1rem; }
.office { margin: 2.5rem 0 0; }
.office[hidden] { display: none; }
.office img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--mist);
}
.office figcaption { margin-top: 0.625rem; font-size: 0.875rem; color: var(--slate); }

h3.sub { font-size: 1.25rem; line-height: 1.3; margin-bottom: 1rem; }
.company-side > h3.sub:first-child { margin-top: 0.4rem; }
#board-wrap { margin-top: 2.75rem; }
#board-wrap[hidden] { display: none; }

.details { margin: 0; border-top: 1px solid var(--ink); }
.details > div {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rule);
}
.details dt { font-size: 0.9375rem; color: var(--slate); }
.details dd { margin: 0; }
.registry-note { margin-top: 1rem; font-size: 0.9375rem; color: var(--slate); }

.board { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.board li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rule);
}
.board .role { color: var(--slate); }

/* ---------- Контакты ---------- */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 56rem;
  gap: 1.5rem 2.5rem;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink);
}
.contacts-grid dt { font-size: 0.875rem; color: var(--slate); }
.contacts-grid dd { margin: 0.375rem 0 0; font-size: 1.125rem; line-height: 1.45; overflow-wrap: anywhere; }
.contact-note { display: block; margin-top: 0.375rem; font-size: 0.9375rem; color: var(--slate); }

/* ---------- Подвал ---------- */
.site-footer {
  background: var(--mist);
  color: var(--slate);
  font-size: 0.875rem;
  line-height: 1.55;
  padding: 2.25rem 0 2.75rem;
}
.footer-row { display: grid; gap: 0.5rem; }
.noscript { padding: 2rem var(--gutter); }

/* Незаполненное поле */
.ph {
  padding: 0 0.2em;
  border-radius: 2px;
  background: rgba(44, 52, 148, 0.06);
  outline: 1px dashed rgba(44, 52, 148, 0.5);
  outline-offset: 1px;
  color: var(--accent);
}

.load-error { padding: 3rem 0; color: var(--ink); }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .nav { gap: 1.375rem; }
  .header-row { gap: 1.5rem; }
}

@media (max-width: 960px) {
  .hero-grid,
  .assets-grid,
  .company-grid { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: 16em; }
}

@media (max-width: 880px) {
  :root { --header-h: 3.5rem; }
  .header-row { gap: 0.75rem; }
  .menu-btn { display: inline-flex; align-items: center; }
  .brand { gap: 0.75rem; }
  .brand-logo { height: 2.375rem; }
  .brand-sub { height: 1.5rem; padding-left: 0.75rem; font-size: 0.875rem; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: auto;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--gutter) 1rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 12px 24px -16px rgba(31, 38, 43, 0.35);
  }
  .site-header.is-open .nav { display: flex; }
  .nav a {
    height: 3rem;
    padding: 0 0 0 0.875rem;
    border-bottom: 0;
    border-left: 3px solid transparent;
    font-size: 1.0625rem;
  }
  .nav a + a { border-top: 1px solid var(--rule); }
  .nav a:hover { border-bottom-color: transparent; }
  .nav a.is-current { border-left-color: var(--accent); }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .cats {
    gap: 1.5rem;
    padding-right: 2.5rem;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
  }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 0.375rem; padding: 1.125rem 0; }
  .doc-date { font-size: 0.875rem; }
  .doc-file { justify-self: start; text-align: left; }
  .tools { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); }
  .field-search { max-width: none; }
  .field select { min-width: 0; width: 100%; }
  .count { grid-column: 1 / -1; margin-left: 0; padding-bottom: 0; }
  .details > div,
  .board li { grid-template-columns: minmax(0, 1fr); }
  .contacts-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-actions { gap: 1rem 1.5rem; }
}

@media (max-width: 380px) {
  .brand { gap: 0.5rem; }
  .brand-logo { height: 2.125rem; }
  .brand-sub { padding-left: 0.5rem; font-size: 0.75rem; letter-spacing: 0.08em; }
  .lang button { padding-left: 0.25rem; padding-right: 0.25rem; }
}

@media print {
  .site-header, .draft, .filters, .hero-actions, .latest-all, .skip { display: none !important; }
  .section { border-top: 1px solid #999; padding: 1.5rem 0; }
  a { color: inherit; }
}
